Flows
A flow is a named trigger plus an ordered list of actions. When the flow is triggered, its actions run in order on the platform's background job queue, and every run is recorded with the result of each step. Use flows to call a webhook after something happens in your app, or to automate a routine call without running your own worker.
Concepts
| Term | Meaning |
|---|---|
| Trigger | manual, webhook or schedule. Only manual can be fired today — you start it from the dashboard or the trigger route. webhook and schedule definitions are accepted and stored, but nothing receives or schedules them yet. |
| Action | A step. log writes a message; http.request calls a URL (method, url, optional headers and body). |
| Run | One execution. It stores its status, the input it was given and one { type, ok, status?, detail? } result per action. |
In the dashboard
Open your project and choose Flows.
- New flow — give it a name, pick a trigger, and add one or more actions (a message to log, or a method and URL to call).
- Run — trigger a flow now. A disabled flow cannot be run.
- Enable or disable a flow, review its recent runs, or delete it.
Definition
{
"name": "Notify on signup",
"trigger": { "type": "manual" },
"actions": [
{ "type": "log", "message": "new signup" },
{
"type": "http.request",
"method": "POST",
"url": "https://hooks.example.com/signup",
"headers": { "Content-Type": "application/json" },
"body": { "source": "basefyio" },
"continueOnError": false
}
],
"enabled": true
}nameis required, and there must be at least one action.- If an action fails, the run stops — unless that action sets
continueOnError. - An
http.requestURL is checked when it runs: loopback, private and link-local addresses and the platform's own internal hosts are refused, so a flow cannot be used to reach internal services.
REST API
All routes are under https://api.basefyio.com/api/projects/:projectId/flows. They need your project's service key (apikey header) or a dashboard session; the anon key is refused with 403.
| Method | Path | Description |
|---|---|---|
| GET | / | List flows |
| POST | / | Create a flow |
| GET | /:id | One flow |
| PATCH | /:id | Replace the definition |
| DELETE | /:id | Delete — returns { deleted: true } |
| POST | /:id/enable | Enable |
| POST | /:id/disable | Disable |
| POST | /:id/trigger | Run now. Optional body { "input": … }; returns { runId, status } |
| GET | /:id/runs | The last 50 runs, newest first |
Example
API=https://api.basefyio.com/api
# Create a flow
FLOW=$(curl -s $API/projects/$PROJECT_ID/flows \
-H "apikey: $SERVICE_KEY" -H "Content-Type: application/json" \
-d '{"name":"ping","trigger":{"type":"manual"},"actions":[{"type":"http.request","method":"GET","url":"https://example.com/health"}]}' \
| jq -r .id)
# Run it, then read the result of each step
curl -s -X POST $API/projects/$PROJECT_ID/flows/$FLOW/trigger \
-H "apikey: $SERVICE_KEY" -H "Content-Type: application/json" \
-d '{"input":{"reason":"test"}}'
curl -s $API/projects/$PROJECT_ID/flows/$FLOW/runs -H "apikey: $SERVICE_KEY"Errors
- 400 — a missing
name, an unknown trigger or action type, no actions, anhttp.requestwithout aurl, or triggering a disabled flow (Flow is disabled). - 403 — the anon key, or a caller who is not a member of the project's team.
- 404 —
Flow not found.