Files
sam c30624a59e
Quality / check (push) Successful in 4m12s
deploy / gate (push) Successful in 4m42s
deploy / archied-image (push) Successful in 3m13s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
feat(workflow): a handoff starts a separate linked run of the next workflow (#1791)
2026-11-03 20:56:03 +11:00

24 lines
1.2 KiB
Go

package task
import "context"
// Caller starts a workflow.call callee and reads it back.
type Caller interface {
// StartCall enqueues the callee for callerTaskID's call step at depth + 1.
// callKey is the call site's durable identity -- the call step's declared
// path within the run, plus the workflow it starts -- and is required: the
// same caller and key return the child already started, so a retry of a
// call site starts one child.
// It fails if the caller is not running or the depth limit is exceeded.
StartCall(ctx context.Context, callerTaskID int64, callKey, workflow string, inputs map[string]any) (*Task, error)
// CallStatus reads one call's callee: its status, latest transition detail
// and written outputs. A store only answers for a task whose
// call_parent_task_id is callerTaskID, so a caller reads only its own
// callees.
CallStatus(ctx context.Context, callerTaskID, callTaskID int64) (status, detail string, outputs map[string]any, err error)
// Handoff completes the running task fromTaskID with detail and starts
// its linked successor on the same work item under workflow, returning
// the successor.
Handoff(ctx context.Context, fromTaskID int64, workflow, detail string) (*Task, error)
}