Skip to content

Runtime API

Builds and executes the workflow graph.

Methods:

  • node(name, &block): define a node block under a symbolic name.
  • edge(from, to, branch: nil): add a normal edge or a barrier join edge.
  • set_entry_point(name): mark the first node.
  • set_finish_point(name): route a node to AsyncGraph::FINISH.
  • step(state:, node:, resolved: {}, resolve_request: nil): execute one logical step.
  • edges_from(node): inspect configured destinations.
  • join?(node): check whether a node is a barrier join.
  • join_for(node): return the source nodes expected by a join.
  • process_join(token:, joins:): park or release join tokens for custom runners.
  • validate!: validate the graph before execution-facing operations.

Used inside node blocks to suspend on external work.

Methods:

  • call(key, kind, payload = {})
  • all(definitions)

Explicit control signal returned from a node.

Helpers:

  • goto(node)
  • update(delta)
  • update_and_goto(delta, node)

Optional helper for applications that want the gem to manage persisted execution state between passes while still keeping persistence and job execution outside the gem.

Methods:

  • start_run(state:, token_uid: "t1"): build a persisted run snapshot with runner-managed tokens and joins.
  • advance_run(run:, resolved: nil, resolve_request: nil) { |request| ... }: advance one persisted run by one pass.
  • start(state:, token_uid: "t1"): build an entry token for persisted execution.
  • step(token:, joins:, resolved: {}, resolve_request: nil) { |request| ... }: low-level token step for custom runners.

Fields:

  • state
  • node
  • requests

Fields:

  • state
  • destinations

Fields:

  • state

Fields:

  • status
  • tokens
  • joins
  • state
  • requests
  • request_refs

Fields:

  • status
  • tokens
  • joins
  • result

Fields:

  • joins

Fields:

  • token
  • joins
  • AsyncGraph::ValidationError
  • AsyncGraph::JoinConflictError
  • AsyncGraph::FINISH
  • AsyncGraph::DEFER
  • AsyncGraph::Request
  • AsyncGraph::Edge
  • AsyncGraph::AwaitSignal