Start a build
Starts a build of the flow: a conversation with the build agent, which writes the flow's code in a project of the build's own. The project starts from the flow's code as it is deployed now, or empty for a flow without code, so a build both creates a flow and changes one; a deploy made later doesn't reach a build already started. The prompt is the build's first; the agent works on it in the background, and GET /builds/{build}/events streams what it does. Each prompt that comes back clean with code deploys it to the flow (deploy). Only the flow's owner (or an admin) can build it. A flow runs one build at a time.
BearerAuthAuthorizationBearer <JWT>Admin token, API token issued via /api-tokens, or an OIDC JWT access token issued by the configured OIDC provider.
flow*stringuuidapplication/json- body
prompt*stringWhat the user asks the agent, in plain words.
1 <= length <= 32768integrations?array<>Integration hints: the integrations, actions and triggers the user wants the flow to use, picked from GET /integrations/catalog, as <name> or <name>#<export> (slack, slack#sendMessage). The agent is told of them and decides; a hint the catalog doesn't have is passed on as given. Kept on the user's message in messages, as a data-integrations part.
items <= 32The build, running its first prompt.
application/json- response
A build of a flow: a conversation with the build agent, which writes the flow's code in a project of the build's own.
name*stringUnique resource name.
flow*stringThe flow built.
state*stringRUNNING while the agent works on a prompt or an answer; AWAITING_INPUT when it asked question; IDLE once it ended otherwise, ready for the next prompt.
"RUNNING""AWAITING_INPUT""IDLE"question?The agent's question (Flash's ask_user_question): up to four questions, answered together.
deploy?stringThe deploy of the code the build's last clean prompt wrote: the agent's job indexes that code as a bundle PATCH /flows/{flow} would be, and the deploy has already succeeded once the build leaves RUNNING, so the flow has the code from then on. Code that can't be indexed is not deployed: the build's error says why. Absent before one, and once the deploy is no longer kept. A stale build deploys nothing more.
stale*booleanWhether the flow was deployed from elsewhere (an upload, another build) since the build started from its code, or since the build's own code last went live. A stale build edits outdated code, so it takes no more prompts or answers (409) and deploys nothing more; start a new build. A deploy that makes a build stale stops the prompt it is running.
error?Why the build's last prompt failed.
messages?array<>The conversation, as AI SDK UI messages (UIMessage): the user's prompts (a text part) and answers (a data-answer part), and the agent's message of each prompt or answer, made of the chunk events of GET /builds/{build}/events. Only GET /builds/{build} returns them.
createTime*stringTime at which the build was started.
date-timeupdateTime*stringTime at which the build last changed.
date-timecurl -X POST 'https://example.com/api/hub/flows/497f6eca-6276-4993-bfeb-53cbbbba6f08/builds' \ -H 'Content-Type: application/json' \ -d '{ "prompt": "string"}'{ "name": "builds/0190f5a2-7c3e-7b1a-9d4e-2f6a8b0c1d3e", "flow": "flows/550e8400-e29b-41d4-a716-446655440000", "state": "RUNNING", "question": { "toolCallId": "string", "questions": [ { "question": "string", "header": "string", "options": [ { "label": "string", "description": "string" } ], "multiSelect": true } ] }, "deploy": "deploys/0190f5a2-7c3e-7b1a-9d4e-2f6a8b0c1d3e", "stale": true, "error": { "reason": "INPUT", "message": "string" }, "messages": [ {} ], "createTime": "2019-08-24T14:15:22Z", "updateTime": "2019-08-24T14:15:22Z"}