Example requests
Ask your coding agent for an automation with known steps. It can turn that request into a workflow whose steps are tracked, retried, and inspected.“When a new signup comes in, research the account, score the lead, add it to Salesforce, and post a brief to Slack.”
“Every Friday, collect closed deals from HubSpot, generate a sales summary, and email it to the leadership team.”
“When a support escalation is approved, create a Linear issue, notify the account owner, and wait for a human resolution before closing the loop.”
How workflows are defined
In Keystroke, workflows live in your project code undersrc/workflows/. Each file default-exports a defineWorkflow() definition with typed input and output, and the runtime discovers it when you run or deploy the project.
src/workflows/signup-pipeline.ts
run function is normal async/await code. Each .run() (or agent .prompt()) call is recorded as a durable step, so the workflow can replay completed steps instead of repeating them.
What workflows can do
Workflows are one of the main primitives in a project, alongside agents, actions, and triggers. Reach for a workflow when the work is a known sequence that should run reliably; reach for an agent when the work needs open-ended reasoning. The two compose: a workflow can prompt an agent as a step, and an agent can run a workflow as a tool.
How to run workflows
Most workflows run from a trigger, such as a webhook, schedule, poll, or app event attached to the workflow. While building, run them directly from the CLI:Running deployed workflows
Deploy your project, then run the workflow against the deployed project:Next steps
Build workflows
Define workflows with typed input, steps, durability, and waits.
Best practices
Keep workflows replayable at runtime and legible on the canvas.
Run workflows
Start runs from the CLI, triggers, forms, the API, and agent tools.
Workflow forms
Publish a public form that starts a run from a shareable link.
Test workflows
Run workflows in tests and assert their output.
Workflow runs
Inspect input, output, steps, errors, and traces.