npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@venturialstd/workflow

v0.1.114

Published

Workflow Module for Venturial

Readme

Workflow Module

A comprehensive workflow management module for Venturial that handles workflow creation, execution, and session management.

Features

  • Workflow Management: Create, update, and manage workflows with nodes and edges
  • Node Types: Support for multiple node types (Chatbot, AI, Conditional, Twilio)
  • Execution Tracking: Track workflow executions with status and data
  • Session Management: Persistent sessions for multi-step workflows
  • Execution Modes: Support for single-run and persistent session workflows

Installation

npm install @venturialstd/workflow

Entities

Workflow

Main workflow entity containing:

  • name: Workflow name
  • active: Whether the workflow is active
  • executionMode: single or persistent
  • status: active, inactive, or draft
  • Relationships to nodes, edges, executions, and sessions

WorkflowNode

Represents a node in the workflow:

  • nodeId: ReactFlow node identifier
  • type: Node type (chatbot, ai, conditional, twilio)
  • actionType: Specific trigger or action identifier
  • properties: Node-specific properties (JSONB)
  • position: Node position on canvas (x, y)

WorkflowEdge

Represents connections between nodes:

  • edgeId: ReactFlow edge identifier
  • source: Source node ID
  • target: Target node ID
  • sourceHandle / targetHandle: Handle identifiers

WorkflowExecution

Tracks individual workflow runs:

  • status: pending, running, completed, failed, cancelled
  • sessionId: Optional session ID for persistent workflows
  • currentNodeId: Current node being executed
  • inputData / outputData / errorData: Execution data

WorkflowSession

Manages persistent workflow sessions:

  • userId: Optional user identifier
  • externalId: External identifier (phone, email, etc.)
  • currentNodeId: Current node in session
  • context: Session context/variables (JSONB)
  • history: Array of node execution history

WorkflowModuleCredential

Stores credentials for workflow modules:

  • moduleId: Module identifier (e.g., 'twilio', 'ai')
  • name: User-defined name for this credential set
  • credentials: Encrypted credential values (JSONB)
  • organizationId: Optional organization scope
  • userId: Optional user scope
  • isActive: Whether the credential is active

Services

All services extend TypeOrmCrudService and provide CRUD operations via @dataui/crud.

WorkflowService

  • getWorkflowsByOrganization(organizationId)
  • getActiveWorkflows(organizationId?)
  • activateWorkflow(workflowId)
  • deactivateWorkflow(workflowId)
  • getWorkflowWithNodesAndEdges(workflowId)

WorkflowNodeService

  • getNodesByWorkflowId(workflowId)
  • getNodeByNodeId(workflowId, nodeId)
  • updateNodeProperties(id, properties)
  • updateNodePosition(id, position)

WorkflowEdgeService

  • getEdgesByWorkflowId(workflowId)
  • getEdgeByEdgeId(workflowId, edgeId)
  • getEdgesBySourceNode(workflowId, sourceNodeId)
  • getEdgesByTargetNode(workflowId, targetNodeId)

WorkflowExecutionService

  • getExecutionsByWorkflowId(workflowId)
  • getExecutionsBySessionId(sessionId)
  • getActiveExecutions(workflowId?)
  • startExecution(executionId)
  • completeExecution(executionId, outputData?)
  • failExecution(executionId, errorMessage, errorData?)
  • updateCurrentNode(executionId, currentNodeId)

WorkflowSessionService

  • getSessionsByWorkflowId(workflowId)
  • getActiveSessions(workflowId?)
  • getSessionByExternalId(workflowId, externalId)
  • getSessionByUserId(workflowId, userId)
  • updateSessionContext(sessionId, context)
  • addToSessionHistory(sessionId, nodeId, data?)
  • deactivateSession(sessionId)

WorkflowModuleCredentialService

  • getCredentialsByModule(moduleId, organizationId?, userId?)
  • getCredentialByName(moduleId, name, organizationId?, userId?)
  • getActiveCredentials(moduleId, organizationId?)
  • updateCredential(id, credentials)
  • activateCredential(id)
  • deactivateCredential(id)

Usage

Import the Module

import { WorkflowModule } from '@venturialstd/workflow';

@Module({
  imports: [WorkflowModule],
})
export class AppModule {}

Use Services

import { WorkflowService } from '@venturialstd/workflow';

@Injectable()
export class MyService {
  constructor(private workflowService: WorkflowService) {}

  async createWorkflow(data: CreateWorkflowDto) {
    return this.workflowService.create(data);
  }
}

Constants

Execution Modes

  • EXECUTION_MODE.SINGLE: One-time execution
  • EXECUTION_MODE.PERSISTENT: Maintains session state

Node Types

  • NODE_TYPE.CHATBOT
  • NODE_TYPE.AI
  • NODE_TYPE.CONDITIONAL
  • NODE_TYPE.TWILIO

Node Categories

  • NODE_CATEGORY.TRIGGER
  • NODE_CATEGORY.ACTION

Workflow Status

  • WORKFLOW_STATUS.ACTIVE
  • WORKFLOW_STATUS.INACTIVE
  • WORKFLOW_STATUS.DRAFT

Execution Status

  • EXECUTION_STATUS.PENDING
  • EXECUTION_STATUS.RUNNING
  • EXECUTION_STATUS.COMPLETED
  • EXECUTION_STATUS.FAILED
  • EXECUTION_STATUS.CANCELLED

DTOs

All DTOs follow the Create*Dto pattern:

  • CreateWorkflowDto
  • CreateWorkflowNodeDto
  • CreateWorkflowEdgeDto
  • CreateWorkflowExecutionDto
  • CreateWorkflowSessionDto
  • CreateWorkflowModuleCredentialDto
  • UpdateWorkflowModuleCredentialDto

Database Schema

The module uses PostgreSQL with JSONB columns for flexible data storage:

  • Node properties stored as JSONB
  • Edge data stored as JSONB
  • Execution input/output/error data as JSONB
  • Session context and history as JSONB
  • Module credentials stored as JSONB (should be encrypted at application level)

Module Credentials

Each module can define required credential fields. Users can create multiple credential sets per module:

Defining Credential Fields in Modules

Modules can define credentialFields in their module definition:

credentialFields: [
  {
    id: 'apiKey',
    name: 'API Key',
    description: 'API key for the service',
    type: FIELD_TYPE.STRING,
    validation: { required: true },
    sensitive: true, // Will be encrypted/masked
    required: true,
  },
]

Managing Credentials

// Create credentials for a module
const credential = await credentialService.create({
  moduleId: 'twilio',
  name: 'Production Twilio',
  credentials: {
    accountSid: 'AC...',
    authToken: '...',
  },
  organizationId: 'org-123',
});

// Get all credentials for a module
const credentials = await credentialService.getCredentialsByModule(
  'twilio',
  'org-123'
);

License

Part of the Venturial Core NPM package.