This repository includes a feature to chain multiple prompts together into a single, executable workflow. This allows you to build more complex, multi-step processes from the individual prompts in the library.
Workflows are defined in .workflow.yaml files and are stored in the workflows/ directory.
A workflow consists of a series of steps, where each step executes a single prompt. The system allows you to map the output of one prompt to the input of a subsequent prompt, creating a data pipeline.
Workflows are executed using the run_workflow.py script.
Workflow files (.workflow.yaml) have a clear and defined structure. For a detailed explanation of the schema, including all available fields and examples, please see the Workflow Schema Documentation.
To execute a workflow, use the scripts/run_workflow.py script from the root of the repository.
The script requires a single argument: the path to the workflow file you want to run.
python3 scripts/run_workflow.py path/to/your/workflow.workflow.yaml
Most workflows require initial inputs to get started. You can provide these using the -i or --input flag. The format is key='value'.
For example, the agentic_coding.workflow.yaml requires a product_concept as input:
python3 scripts/run_workflow.py workflows/agentic_coding.workflow.yaml -i product_concept="A mobile app for identifying plants from photos."
You can provide multiple inputs by using the flag multiple times:
python3 scripts/run_workflow.py path/to/workflow.yaml -i input1="value1" -i input2="value2"
Since the script cannot make live calls to an AI model, the execution of each prompt is simulated. Here’s what happens at each step:
map_inputs section of the workflow step.testData section in the .prompt.yaml file.
testData is present, it uses the expected output from a test case (preferably one that matches the current inputs).testData is available, a generic placeholder output is generated.This simulation allows you to test the logic and data flow of your workflow without needing API keys or incurring costs.