Flank API
Flank is the visual workflow editor for the brain-owned workflow engine. It does not expose an API of its own and it does not own workflow data — it is a client of brain’s HTTP workflow API. This page documents the brain endpoints flank consumes and how flank’s editor surface maps onto them.
For the canonical definitions of Workflow, Subworkflow, Node, Engine, Execution, and Contract, see the T-Bone glossary.
How flank consumes brain
Flank’s TanStack Start server functions call brain over HTTP for every workflow
operation. The client lives in apps/flank/app/lib/brain-http-client.ts. The editor
itself (ReactFlow canvas) never talks to brain directly — it goes through these server
functions, which attach the caller’s Clerk session and forward to brain.
Brain authorizes workflow operations behind the ADMIN role. The human surfaces
(flank, fennec) authenticate with a Clerk session against brain’s
/workflow/* controllers; sirloin authenticates service-to-service against brain’s
API-key “Beef” surface (@Controller('api/*')). Flank only uses the Clerk-session
surface.
Operations flank uses
These are the brain workflow-engine operations flank’s server functions invoke. The authoritative request/response shapes live in brain; this is the editor’s view of them.
| Operation | Purpose |
|---|---|
| List / get workflows | Populate the editor’s workflow list and load a graph for editing. |
| Save workflow (create / update draft) | Persist graph + input schema edits back to brain as a draft. |
| Get workflow contract | Read the input_schema / pricing / output_schema brain serves, to render and validate node configuration. |
| Publish workflow | Promote a draft to a numbered, immutable version that external executors may use. |
| Execute / sandbox a workflow | Run a draft as a test (sandbox) execution without a published version, or trigger a normal execution. |
| List / get executions | Read executions and their per-node traces (status, timing, inputs, outputs, errors) for the editor’s execution views. |
Subworkflows are handled through the same workflow operations (a workflow pins a subworkflow version); nodes are edited as part of a workflow’s graph, not as standalone entities.
Editor surface
Flank’s own HTTP surface is the TanStack Start app on port 3100: the editor routes and
the server functions behind them. It is consumed only by the browser-based editor, not by
other services.
apps/flank/app/routes/— editor and execution routes (e.g.workflows.$id.tsx,executions.$id.tsx)apps/flank/app/components/flow/— the ReactFlow editor (FlowEditor, NodePalette, NodeConfigPanel, nodes)apps/flank/app/lib/brain-http-client.ts— the brain HTTP client used by server functionsapps/flank/app/lib/— graph serialization and other client utilities
Legacy, being retired. Flank previously exposed a gRPC
FlankExecutionService(running executions in its own in-process engine) and consumed a gRPCFlankStorageServiceimplemented by sirloin (workflow/adapter/secret/execution CRUD), with an agenticFlankMCPtooling layer in sirloin. Those paths are superseded by brain’s HTTP API. Where any of that wiring still exists it is transitional and should not be built on.TODO(@law): remove the retired gRPC storage/execution/MCP wiring once no flow depends on it.
Source paths
apps/flank/app/lib/brain-http-client.ts— brain HTTP clientapps/flank/app/routes/— editor + execution routesapps/flank/app/components/flow/— ReactFlow editorapps/flank/app/lib/— graph serializer and client utilities