Optionalcontext: JobStateif the job is created/deleted/created with the same key, the 'gid' ensures no stale messages (such as sleep delays) enter the workstream. Any message with a mismatched gid belongs to a prior job and can safely be ignored/dropped.
OptionalmsgGID: stringTrigger the target ancestor to execute in a cycle,
without violating the constraints of the DAG. Immutable
individual activity state will execute in a new dimensional
thread while shared job state can change. This
pattern allows for retries without violating the DAG.
Executes the 3-step Leg1 protocol for Category B activities (Leg1-only with children, e.g., Hook passthrough, Signal, Interrupt-another). Uses the incoming Leg1 message GUID as the GUID ledger key.
Step A: setState + notarizeLeg1Completion + step1 markers (transaction 1) Step B: publish children + step2 markers + setStatusAndCollateGuid (transaction 2) Step C: if edge → runJobCompletionTasks + step3 markers + finalize (transaction 3)
true if this transition caused the job to complete
Executes the 3-step Leg2 protocol using GUID ledger for crash-safe resume. Each step bundles durable writes with its concluding digit update in a single transaction.
true if this transition caused the job to complete
Extracts the job status from the last result of a transaction. Used by subclass Leg1 process methods for telemetry.
Extracts the thresholdHit value from transaction results. The setStatusAndCollateGuid result is the last item.
Optionaltransaction: ProviderTransactionOptionaltransaction: ProviderTransaction
Re-executes an ancestor activity in a new dimensional thread, enabling retry loops and iterative patterns without violating the DAG constraint. The
cycleactivity targets a specific ancestor (typically aHookwithcycle: true) and sends execution back to that point.Each cycle iteration runs in a fresh dimensional thread — individual activity state is isolated per iteration, while shared job state (
job.maps) accumulates across iterations. This pattern enables retries, polling loops, and iterative processing.YAML Configuration
Key Behaviors
ancestorfield must reference an activity withcycle: true.input.mapsoverride the ancestor's output data for the next iteration, allowing each cycle to pass different values.Execution Model
Cycle is a Category A (Leg 1 only) activity:
See
CycleActivity for the TypeScript interface