Stockflow executes business workflows written in YAML.
You define workflow logic once in YAML, and the runtime executes it through API endpoints.
- Inspired by Kestra and Supabase.
- Built to support a safer, more controlled backend workflow model for security-sensitive use cases.
Design and create your PostgreSQL tables first.
From stockflow/ run:
npm run db:generateThis generates/updates Drizzle artifacts used by the project.
Add files under:
stockflow/data/functions/
Basic YAML shape:
name: myFunction
version: 1
temporal: true
params:
id:
type: string
required: true
steps:
- name: result
type: query
with:
collection: customers
filter:
eq:
- id
- "{{params.id}}"
return:
data: "{{steps.result}}"Temporal flags:
- Set top-level
temporal: trueto run all steps with temporal routing. - Set
temporalon a specific step to override the top-level value for only that step. TEMPORAL_STEP_EXECUTOR_URLcontrols where temporal-routed steps are sent.- If
TEMPORAL_STEP_EXECUTOR_URLis not set, flagged steps execute locally.
Endpoint:
POST /api/rpc
Request body:
{
"operation": "myFunction",
"params": {
"id": "123"
}
}Supported step types:
callmapeditFieldreferencequerypersistconditionloop
cd stockflow
npm install
npm run devdocker compose upDATABASE_URLJWT_SECRET
- Keep YAML names consistent with API
operationvalues. - Use
db:generatewhenever schema changes. - Do not commit real credentials to source control.