PersistentAI API Documentation / @persistentai/fireflow-executor / server / ExecutionWorkflows
Class: ExecutionWorkflows
Defined in: packages/fireflow-executor/server/dbos/workflows/ExecutionWorkflows.ts:82
Class-based DBOS workflow for executing fireflow flows
This class provides the main entry point for executing fireflow flows using DBOS. Uses the @DBOS.workflow() decorator for durable execution guarantees.
Signal Pattern:
- Workflow starts immediately but waits for START_SIGNAL before executing
- This allows clients to subscribe to the event stream before execution begins
Command Loop Pattern (Debug Mode Only):
- Command polling (PAUSE/RESUME/STEP/STOP) is ONLY enabled when task.debug=true
- In production mode (debug=false): Zero overhead - no polling, no recv() calls
- In debug mode: Command loop runs in background, awaited after execution completes
- No overlapping recv() calls - single sequential loop
DBOS Durability Guarantees:
- Each step is checkpointed in PostgreSQL
- If the worker crashes, DBOS automatically resumes from the last completed step
- The workflow is guaranteed to run to completion (at-least-once semantics)
- Idempotency is ensured through workflow ID (executionId)
Extends
ConfiguredInstance
Constructors
Constructor
new ExecutionWorkflows(
name?):ExecutionWorkflows
Defined in: packages/fireflow-executor/server/dbos/workflows/ExecutionWorkflows.ts:83
Parameters
name?
string = 'ExecutionWorkflows'
Returns
ExecutionWorkflows
Overrides
ConfiguredInstance.constructor
Properties
name
readonlyname:string
Defined in: node_modules/.pnpm/@dbos-inc+dbos-sdk@4.7.9_bufferutil@4.0.9_pg-native@3.5.2_utf-8-validate@5.0.10/node_modules/@dbos-inc/dbos-sdk/dist/src/decorators.d.ts:126
Inherited from
ConfiguredInstance.name
Methods
initialize()
initialize():
Promise<void>
Defined in: packages/fireflow-executor/server/dbos/workflows/ExecutionWorkflows.ts:87
Override this method to perform async initialization between construction and DBOS.launch().
Returns
Promise<void>
Overrides
ConfiguredInstance.initialize
executeFireFlow()
staticexecuteFireFlow(task):Promise<ExecutionResult>
Defined in: packages/fireflow-executor/server/dbos/workflows/ExecutionWorkflows.ts:99
Execute a fireflow flow with durable workflow orchestration
Parameters
task
Execution task containing executionId and flowId
Returns
Promise<ExecutionResult>
Execution result with status and duration