Use agents in multistep workflows
Place an agent between data preparation and follow-up steps, with explicit handling for background results.
Add an agent to a multistep integration so it can analyze information gathered earlier and prepare results for later work. You will design the handoff around a background run: the integration starts the agent, then either lets its tools record the findings or reads the results later.
Plan one analysis step
Use a vendor review as a design example. Your integration receives an onboarding request, gathers vendor details, and starts an agent. The agent returns RiskLevel, NeedsReview, and Reason. These are example output names you define in AI Builder.
| Stage | Responsibility | Example data |
|---|---|---|
| Trigger | Integration | New onboarding request and its record ID |
| Prepare | Integration steps | Vendor name, website, and relevant enterprise-system details |
| Analyze | Agent | Risk rating, review flag, and explanation |
| Record | Agent tool or later integration step | Findings linked to the original request |
| Decide | App workflow and reviewer | Approve, request evidence, or reject |
Keep the request ID available throughout the workflow. Give tools only the permissions needed for the records they will read or change.
Build the handoff
- Define the agent inputs and typed outputs. Use a Yes/No output for a review flag and Text for the explanation. State how to handle missing information.
- Under Blueprint > Custom Agents, click Run the example to test the Draft, then click Generate to create and publish the agent. Tools act for real during tests.
- Create an integration with the business-event trigger and any steps needed to prepare inputs.
- Add Make an HTTP call (POST) to start the agent. Call
POST /agent/2/{AccountId}/application/{AppId}/custom-agent/{AgentId}/execute, map prepared values into theInputDataobject and supply the access-key headers described in the Agent API. - Save the returned
ExecutionIdwith the request if a later step will read results. - Configure one of the completion routes below, then test the complete path with a safe request.
Choose how to finish the work
Important
The integration hands work to the agent and continues without waiting. A successful start response is not an analysis result.
For tool writeback, give the agent a tool that updates the request and, if needed, sends a notification. Specify the target record and the conditions for each action in the instructions. An agent may make changes before a run fails, so inspect the record before repeating the run.
For a later read, add a Delay step of at least one hour, then call the run's GET endpoint (.../execution/{ExecutionId}) with its saved ID. Check the Status. Only use outputs ({"items":[...]}) from a Completed run. Route Failed runs to someone who can inspect the error and any actions already taken. If the run is Queued, NotStarted or Running, preserve its ID for another read. Runs are never retried automatically and can't be canceled.
Keep review and re-entry explicit
For decisions about money, contracts, or other consequential work, let the agent prepare findings and send the request to a human approval step. Approval before an agent tool acts is not built in; design the agent to prepare a draft item for review instead.
Add an integration condition to prevent a results update from starting the same review again. Test missing inputs, a failed connection, and a failed run as well as the successful path. After changing an input or output, recheck every step that maps it.

