Skip to main content

FlowEffectHandler

@retinue/monorepo


@retinue/monorepo / backend/src / FlowEffectHandler

Type Alias: FlowEffectHandler

FlowEffectHandler = object

Defined in: backend/src/flows/runner.ts:35

What a host has to be able to do for a flow to run.

Ports, not a class: the platform cannot know how a deployment runs an agent or asks a person, and every one of these is something the deployment already does for its assistant surface. A flow is composition over them, not a second way of doing them.

Methods​

askHuman()​

askHuman(context, input): Promise<StepOutcome>

Defined in: backend/src/flows/runner.ts:62

Raises a question through the existing HITL path and returns parked with the interaction it raised.

Parameters​

context​

ExecutionContext

input​
options?​

readonly string[]

question​

string

Returns​

Promise<StepOutcome>


callTool()​

callTool(context, input): Promise<StepOutcome>

Defined in: backend/src/flows/runner.ts:57

Parameters​

context​

ExecutionContext

input​
idempotencyKey​

string

input​

Readonly<Record<string, unknown>>

tool​

string

Returns​

Promise<StepOutcome>


runAgent()​

runAgent(context, input): Promise<StepOutcome>

Defined in: backend/src/flows/runner.ts:46

Run an agent step.

A handler that creates a child run returns parked-on-run and the flow waits for it; one that runs a turn inline returns ok. Both are legal, and the first is what #202 is for: a child run earns checkpointing, recovery, quota admission and its own usage rows, and an inline turn earns none of them.

budgetRemaining is what the flow has left, re-derived per step. A child given its own independent ceiling is a member that can outspend the team.

Parameters​

context​

ExecutionContext

input​
agentId​

string

budgetRemaining​

{ costMinorUnits?: number; steps: number; wallClockMs?: number; }

budgetRemaining.costMinorUnits?​

number

budgetRemaining.steps​

number

budgetRemaining.wallClockMs?​

number

idempotencyKey​

string

instructions?​

string

member?​

string

prompt​

string

Returns​

Promise<StepOutcome>


runSubflow()?​

optional runSubflow(context, input): Promise<StepOutcome>

Defined in: backend/src/flows/runner.ts:71

Parameters​

context​

ExecutionContext

input​
depth​

number

flowId​

string

idempotencyKey​

string

Returns​

Promise<StepOutcome>


runTeam()?​

optional runTeam(context, input): Promise<StepOutcome>

Defined in: backend/src/flows/runner.ts:67

A team, which is a compiled flow — so a handler may simply call the runner again.

Parameters​

context​

ExecutionContext

input​
idempotencyKey​

string

prompt​

string

teamId​

string

Returns​

Promise<StepOutcome>