Data Orchestration via API
Use the Lendflow API to run a published Data Orchestration template on a deal, monitor the run, inspect its decision history, and act on the result. A deal is represented by an application in the API. Before you begin, obtain a Bearer token, the application ID for the deal, and access to a published Data Orchestration template that is compatible with the application.API flow
- Find a published template. Call List Data Orchestration Templates with the application ID and
stage_id. Save the templateid; you will send it astemplate_idwhen starting the run. - Start Data Orchestration. Call Execute Data Orchestration for the application with
template_id,application_id, and the applicablestage_id. - Confirm the request was accepted. A successful request returns
200 OKwithdata.executedset totrue. The response does not returntemplate_id. Execution is scheduled asynchronously, so this response does not mean that processing has finished. - Monitor the run. Use List Data Orchestration Logs to list recent runs and obtain the log ID. Then use Get Data Orchestration Log with the application ID and log ID to retrieve one run. The log resource includes the overall
outcome,master_status, timestamps, errors, and status history. Refer to these API Reference endpoints for the complete current response schema. - Inspect decision details. Use
historyto review each evaluated step. When you need to identify the condition that produced a pass, fail, or review result, inspect the step’scontext.log, including its attribute, conditions, value, outcome, and boolean evaluation results. - Act on the outcome. Your integration can map the overall result or individual step outcomes to its next action. For example, after your organization has configured its document requirements and supplied their IDs, use Update Application Stips to set required documents on the application. Keep this mapping in your integration so that the documents added to a deal match your organization’s policy.
Continue or override an existing run
The execute operation starts a new run. The following operations use thelog_id of an existing run and do not create a separate run:
The retry and pass/fail continuation operations return
202 Accepted with an empty JSON object. Updating the master status returns 200 OK with the updated log under data.
Master status values
Usemaster_status to determine whether the run is still active or has reached a terminal result.
The top-level
master_status describes the overall run. The outcomes inside history explain how individual steps contributed to that result.
Webhook notifications
If your integration should receive notifications instead of polling the logs endpoints, configure the applicable Data Orchestration events in Custom Workflow Webhooks.FAQ
Does starting Data Orchestration return an empty response?
Does starting Data Orchestration return an empty response?
No. A successful request returns
200 OK with data.executed set to true. It does not return template_id. Use List Data Orchestration Logs to find the scheduled run and monitor its status.How do I know when a run has finished?
How do I know when a run has finished?
Retrieve the log and check
master_status. Values 4, 5, and 6 represent Complete Pass, Complete Fail, and Error. Values 0, 2, and 3 represent Not Started, Processing, and Review.Where can I see which rule caused the result?
Where can I see which rule caused the result?
Retrieve the individual log and inspect its
history. Each step can include context.log entries showing the evaluated attribute, value, conditions, outcome, and evaluation results.Can I require documents based on the result?
Can I require documents based on the result?
Yes. Map the overall result or relevant step outcomes to your organization’s document IDs, then call the Update Application Stips endpoint for the application.
Should I poll the log or use a webhook?
Should I poll the log or use a webhook?
Use log polling when your integration controls the check interval. Use Custom Workflow Webhooks when your integration should receive event notifications at a configured URL.
Does retrying start a new Data Orchestration run?
Does retrying start a new Data Orchestration run?
No. Execute Data Orchestration starts a new run. Retry Last Data Orchestration Step and the pass/fail continuation operations act on an existing run identified by
log_id.Next steps
Configure Custom Workflow Webhooks
Send workflow and Data Orchestration notifications to your integration.