Flow Builder
Orchestrate decision trees, pricing engines, integrations, messages and webhooks into one automated flow, then test, publish and monitor every run.
Flow Builder lets you connect the building blocks of a lending decision into one automated process on a visual canvas. A flow can call an integration, run a decision tree, branch on the result, price offers, wait, send an email, and notify your systems, all in order. Flows are versioned like decision trees: you edit a draft, test it, publish it, and choose which version is live. Every run is recorded so you can see the exact path an application took.
BetaFlow Builder is marked Beta in the dashboard sidebar.
Key concepts
- Trigger: how a flow starts. Every flow has exactly one.
- Node: one step on the canvas. Nodes are connected by edges that set the order.
- Inputs: the variables the trigger expects. They become the request body for API runs.
- Draft: the editable version. Saving changes updates the draft.
- Live version: the published version that new runs use.
- Run: one execution of a flow. Each run is tied to an application.
- Execution path: the ordered list of nodes a run passed through, with status, timing, inputs and outputs.
How flows work
Triggers
- API: your system starts the flow by calling its run URL with the trigger's inputs. A new application is created for each run.
- Application: the flow runs for an existing application and reads that application's data. Use it as part of an application journey.
Once an Application-trigger flow is published, you can add it to an application journey in Product Studio: select a page, and in Page Settings → On Continue, choose the flow in the Initial Provider or Final Provider list.
Node types
The palette groups nodes into three categories.
- Rule: runs the live version of a Rules Studio decision tree. The flow branches into one path per outcome the tree can return.
- Pricing Engine: runs a pricing engine and, optionally, its child engine.
- Integration: calls a connected provider (for example a credit bureau) and brings its result into the flow.
- Condition: checks a rule block and branches to Yes or No.
- Delay: pauses for a set time (seconds, minutes, hours, days or weeks). You can add a Timeout path.
- Parallel Run: runs several branches at once. The flow continues when all branches finish or the Max wait time is reached; unfinished branches are marked skipped.
- Loop: repeats a set of steps until an exit condition is met or the maximum number of iterations (up to 10) is hit.
- Send webhook: sends selected flow variables to your HTTPS URL as a JSON POST.
- Wait for webhook: pauses until your system calls back with the application ID, then continues. Has a Max wait time.
- End: ends the flow and updates the application's stage from the flow's result.
- Email: sends a templated email to the applicant.
- SMS: sends a templated text message (only if SMS is enabled for your account).
Webhook nodes.
Send webhook: headers and retries
Send webhook posts to a public https:// URL. Choose the Key type (Bearer token in the Authorization header, or an X-API-KEY header) and enter the Webhook Key. Each request carries Idempotency-Key and X-Event-Id headers with the same unique value so you can ignore duplicates. LendAPI retries on connection failures, HTTP 429 and 5xx responses.
Wait for webhook: calling back
Wait for webhook shows a URL to copy. Your system calls it with your API key and the application's ID:
curl -X POST "https://app.lendapi.com/flow/wait-webhook/3f6c2a9e-8d1b-4b7e-9a51-0c2d4e6f8a10/" \
-H "Authorization: Bearer test_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "app_id": "9b2f7c1e-1111-4a2b-8c3d-555501000000", "verification_status": "passed" }'app_id is the application's session ID (UUID), returned as app_session when you run the flow. The payload is stored and the flow resumes.
| Status | Meaning |
|---|---|
404 | Nothing is waiting for that application |
410 | The wait expired |
409 | The run was suspended |
400 | app_id is not a valid UUID or the payload is too large |
Flow lifecycle
stateDiagram-v2
[*] --> Draft: Create flow
Draft --> Draft: Save draft / Test flow
Draft --> Published: Publish (validates first)
Published --> Draft: Edit again or Restore As Draft
- Publishing validates the flow. If there are errors, publishing is blocked and the Warnings checklist shows what to fix.
- Inactive flows don't run. API calls return "Flow is not active." and test runs are blocked.
- Delays and webhook waits run in the background. An API run that reaches one returns right away with status
scheduled.
Build and manage flows
Build and publish a flow
- Go to Workflows → Flow Builder and click + Flow.
- In New Flow, enter a Name (for example "Personal Loan Flow") and an optional description.
- On the empty canvas, choose a trigger (API or Application) and select its Inputs. For API triggers the panel also shows the API URL.
- Add nodes from the palette. Click a node to configure it in the side panel; use Swap node to change its type.
- Connect each branch to the next step and finish paths with End.
- Click Save draft regularly.
- Click Test flow. For an API trigger, enter input values. For an Application trigger, Select an application to run against. The test panel shows each node's result, the Branch taken, and output variables. A test run never changes the real application.
- Click Publish. In Publish Flow, enter a Description and tick Set as live version if new applications should use it right away.
The Versions tab lists every version. Click Set Live to switch the live version, or Restore As Draft to copy an older version into the draft.
Monitor and manage runs
Open an application in the Agent Dashboard. In the Overview panel, the Flow field shows which flow and version ran, and Flow Preview opens the run.
- See the execution path: click Flow Preview. Visited nodes are highlighted. Click a node to see its status, runtime, input and output. Statuses include Completed, In Progress, Failed and Suspended.
- Skip a delay: in Flow Preview, click Skip delay on the waiting Delay node. The flow continues immediately and the override is recorded.
- Suspend a run: while a run is in progress, click Suspend Run and confirm. The run stops before its next step.
- Re-run: with the application's Underwriting tab open, click the re-run icon next to Flow Preview and confirm Re-run Flow. The same version runs again using the application's current data, and the current outcome is replaced with the new result. You can't re-run while the flow is still processing.
A suspended run does not resume on its own. To run the flow for that application again, use Re-run.
Run flows via the API
The flow's API tab shows the run URL and a ready-to-copy cURL command with your trigger inputs. Authenticate with Authorization: Bearer <your API key>. Keys that start with live_ run in your Production environment; keys that start with test_ run in your Sandbox.
| Action | Method & path | Notes |
|---|---|---|
| Run a flow | POST https://app.lendapi.com/flow/{flow_id}/run/ | Runs the live version. Body: params (trigger inputs). Application-trigger flows also need app_id or app_session. |
| Resume a waiting flow | POST https://app.lendapi.com/flow/wait-webhook/{flow_id}/ | The URL shown on the Wait for webhook node. Body must include app_id (application session UUID). |
Example: run an API-trigger flow
curl -X POST "https://app.lendapi.com/flow/3f6c2a9e-8d1b-4b7e-9a51-0c2d4e6f8a10/run/" \
-H "Authorization: Bearer test_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "params": { "first_name": "Jane", "last_name": "Doe", "email": "[email protected]", "requested_loan_amount": 15000 } }'{
"flow_id": "3f6c2a9e-8d1b-4b7e-9a51-0c2d4e6f8a10",
"version": 4,
"app_id": 120045,
"app_session": "9b2f7c1e-1111-4a2b-8c3d-555501000000",
"status": "success",
"env": "test",
"result": { "offer_amount": 15000 }
}result contains the flow's output variables. status is success, failed (with an error message) or scheduled (with flow_resume_at) when the flow is waiting on a delay or webhook. Missing required inputs return HTTP 400 with a missing_inputs list. Inputs the flow does not declare are accepted and listed in unrecognized_inputs.
Check status, not just the HTTP codeA run that fails inside the flow still returns HTTP 200 with
"status": "failed". Always checkstatus, not just the HTTP code.
Access and best practices
Permissions
Designing, testing and publishing flows requires the Flow Builder module. Viewing a run's execution path, suspending, skipping delays and re-running are application actions controlled by the Agent Dashboard module. See Roles and Permissions.
Best practices
- Test every branch, including timeouts and failure paths, before publishing.
- Keep secrets out of payloads. Send only the variables your endpoint needs.
- Make your webhook endpoints idempotent using the
Idempotency-Keyheader, because retries can deliver the same event twice. - Use Parallel Run for independent calls (for example two bureaus) to cut run time, and set a sensible Max wait time.
- Prefer Re-run over manual edits when application data changes, so the decision and its audit trail stay consistent.
- Resolve warnings early. The Warnings checklist on the canvas shows setup problems, such as missing variables, that block testing and publishing.
Related guides
Updated 12 minutes ago

