Synaptic (synaptic v0.2.6)
View SourceSynaptic provides a declarative workflow engine with a DSL for orchestrating LLM-backed steps, human-in-the-loop pauses, and resumable executions.
Summary
Functions
Returns the step-level history collected for a workflow run.
Returns a snapshot of the current workflow state for a run id.
Returns a list of currently running workflows with their run ids, workflow module, and snapshot context.
Resumes a previously suspended workflow run with the supplied payload.
Starts a workflow module with the provided input context.
Stops a running workflow. Returns :ok when the runner terminates or
{:error, :not_found} if the run id is unknown.
Subscribes the calling process to PubSub events for the given run_id.
Unsubscribes the calling process from workflow events for the given run_id.
Fetches the compiled workflow definition for a module.
Functions
Returns the step-level history collected for a workflow run.
Returns a snapshot of the current workflow state for a run id.
Options
:timeout- Timeout in milliseconds for the snapshot call (default: 5000). Use:infinityto wait indefinitely.
Returns a list of currently running workflows with their run ids, workflow module, and snapshot context.
Resumes a previously suspended workflow run with the supplied payload.
Starts a workflow module with the provided input context.
Options
:run_id- Custom run ID (defaults to auto-generated):start_at_step- Start execution at a specific step by name (atom). The step must exist in the workflow definition. The provided context should contain all data that would have been accumulated up to that step.
Examples
# Start from the beginning (default)
{:ok, run_id} = Synaptic.start(MyWorkflow, %{initial: :data})
# Start at a specific step with pre-populated context
{:ok, run_id} = Synaptic.start(MyWorkflow, %{precomputed: :value}, start_at_step: :middle_step)
Stops a running workflow. Returns :ok when the runner terminates or
{:error, :not_found} if the run id is unknown.
Subscribes the calling process to PubSub events for the given run_id.
Events are delivered as {:synaptic_event, %{run_id: ..., event: ...}} tuples.
Unsubscribes the calling process from workflow events for the given run_id.
Fetches the compiled workflow definition for a module.