View Source Spooks.WorkflowEngine (Spooks Agentic Workflow Engine v0.1.5)
The Spooks Workflow Engine is responsible for running agentic workflows.
A workflow context is also provided that contains information about how the workflow engine should run. The context holds the workflow module, the repository (required if using checkpoints), and an optional llm that can be used by the workflow agent steps.
There is an event that is passed to each step in the workflow. This event name is used to determine the step function that is called. The function returns a new event which determines the next step in the workflow.
Example
ctx = Spooks.Context.SpooksContext.new(Spooks.Sample.SampleWorkflow, nil)
Spooks.WorkflowEngine.run_workflow(ctx)
Summary
Functions
Gets the name of the step function for the given event.
Resumes a workflow for the given context. Uses the last checkpoint to determine the next step.
Runs a step in the workflow for the given context.
Runs the agentic workflow for the given context.
Starts a workflow for the given context. Ignores any existing checkpoints.
Functions
Gets the name of the step function for the given event.
Resumes a workflow for the given context. Uses the last checkpoint to determine the next step.
If there is no checkpoint, it will raise an error.
Runs a step in the workflow for the given context.
If the step returns an event, it will save a checkpoint and run the next step. If the step returns nil, it will remove the checkpoint and end the workflow.
If the step function does not exist in the workflow module, it will raise an error.
Runs the agentic workflow for the given context.
IF there is a repo, it will check for a checkpoint and resume the workflow.
Starts a workflow for the given context. Ignores any existing checkpoints.