Skip to content

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

readonly name: string

Defined in: node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/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()

static executeFireFlow(task): Promise<ExecutionResult>

Defined in: packages/fireflow-executor/server/dbos/workflows/ExecutionWorkflows.ts:99

Execute a fireflow flow with durable workflow orchestration

Parameters

task

ExecutionTask

Execution task containing executionId and flowId

Returns

Promise<ExecutionResult>

Execution result with status and duration

Licensed under BUSL-1.1