Skip to content

@persistent-ai/fireflow-executor / server / APITaskQueue

Class: APITaskQueue ​

Defined in: packages/fireflow-executor/server/implementations/dbos/APITaskQueue.ts:32

API-only task queue that uses DBOSClient to enqueue workflows without launching the full DBOS runtime.

This ensures the API cannot execute workflows - it only enqueues them. Uses the official DBOS Client API for external applications.

Key differences from DBOSTaskQueue:

  • Uses DBOSClient.enqueue() instead of DBOS.startWorkflow()
  • No DBOS runtime initialization required
  • Cannot execute workflows locally
  • Suitable for API servers that only need to submit tasks

Implements ​

Constructors ​

Constructor ​

new APITaskQueue(systemDatabaseUrl, pgPool?): APITaskQueue

Defined in: packages/fireflow-executor/server/implementations/dbos/APITaskQueue.ts:37

Parameters ​

systemDatabaseUrl ​

string

pgPool? ​

Pool

Returns ​

APITaskQueue

Methods ​

close() ​

close(): Promise<void>

Defined in: packages/fireflow-executor/server/implementations/dbos/APITaskQueue.ts:114

Close the DBOS client and clean up resources

Returns ​

Promise<void>

Implementation of ​

ITaskQueue.close


consumeTasks() ​

consumeTasks(): Promise<void>

Defined in: packages/fireflow-executor/server/implementations/dbos/APITaskQueue.ts:126

Consume tasks from the queue Not supported in API mode - this is a no-op

Returns ​

Promise<void>

Implementation of ​

ITaskQueue.consumeTasks


getClient() ​

getClient(): Promise<DBOSClient>

Defined in: packages/fireflow-executor/server/implementations/dbos/APITaskQueue.ts:107

Get the DBOSClient instance (for passing to tRPC context)

This allows the tRPC router to use the same client for sending signals and cancelling workflows.

Returns ​

Promise<DBOSClient>


publishTask() ​

publishTask(task): Promise<WorkflowHandle<any>>

Defined in: packages/fireflow-executor/server/implementations/dbos/APITaskQueue.ts:67

Publish a task to the DBOS queue via DBOSClient

This enqueues the workflow without executing it locally. The workflow will be picked up by a DBOS worker process.

Parameters ​

task ​

ExecutionTask

Returns ​

Promise<WorkflowHandle<any>>

Implementation of ​

ITaskQueue.publishTask


stopConsuming() ​

stopConsuming(): Promise<void>

Defined in: packages/fireflow-executor/server/implementations/dbos/APITaskQueue.ts:135

Stop consuming tasks Not supported in API mode - this is a no-op

Returns ​

Promise<void>

Implementation of ​

ITaskQueue.stopConsuming

Licensed under BUSL-1.1