Skip to main content

FlowExecutionStore

@forge/monorepo


@forge/monorepo / backend/src / FlowExecutionStore

Interface: FlowExecutionStore

Defined in: backend/src/persistence/index.ts:1837

A running or finished flow execution.

save is a full write of the execution document rather than a patch, because the interpreter produces a whole next state and a patch would need the two to agree about which fields it touched — a second contract, kept in agreement by hand.

Methods

create()

create(input): Promise<void>

Defined in: backend/src/persistence/index.ts:1838

Parameters

input

TenantScope & object

Returns

Promise<void>


get()

get(input): Promise<StoredFlowExecution | null>

Defined in: backend/src/persistence/index.ts:1847

Parameters

input

TenantScope & object

Returns

Promise<StoredFlowExecution | null>


listByFlow()

listByFlow(input): Promise<Page<StoredFlowExecution>>

Defined in: backend/src/persistence/index.ts:1858

For the inspector: what has this flow been doing? #187 AC-7.

Parameters

input

TenantScope & PageRequest & object

Returns

Promise<Page<StoredFlowExecution>>


save()

save(input): Promise<void>

Defined in: backend/src/persistence/index.ts:1846

Overwrite the execution.

Monotonic on steps, like CheckpointStore.save: a save carrying fewer completed steps than the stored one is ignored. Two workers that both picked up the same execution would otherwise let the slower one move it backwards, and a flow that goes backwards re-performs external writes.

Parameters

input

TenantScope & object

Returns

Promise<void>


waitingOnRun()

waitingOnRun(input): Promise<StoredFlowExecution | null>

Defined in: backend/src/persistence/index.ts:1856

The execution parked on a child run — #202.

One at most: a run belongs to a single flow step. Returning null rather than a list says so, and a caller that got a list would have to decide what two parents for one child means.

Parameters

input

TenantScope & object

Returns

Promise<StoredFlowExecution | null>


waitingOnSignal()

waitingOnSignal(input): Promise<readonly StoredFlowExecution[]>

Defined in: backend/src/persistence/index.ts:1849

Executions parked on a signal, so a delivered signal can find what was waiting for it.

Parameters

input

TenantScope & object

Returns

Promise<readonly StoredFlowExecution[]>