refine-cloud-flow
dci refine-cloud-flow <flowId> [body]
Refines the specified CloudFlow by generating and updating nodes and connections based on the provided natural language intent. The operation streams incremental build events as they are produced.
flowId— Identifier of the resource.
Pass the request body as name: value arguments or pipe JSON on stdin — see Command structure.
Like build-cloud-flow, the event stream is parsed into flowId, conversationId, the
builder's answer, and the build steps that ran.
A refine round can answer with a plan yet save nothing (few steps, none of them saving node
parameters). Re-export with dci export-cloudflow-flow <flow-id> after every refine and diff
the bundle before believing the change happened. dci refine-cloudflow is accepted as an
alias.
Examples
# Ask the builder to change an existing flow.
dci refine-cloud-flow <flow-id> question: "Add an approval step before the node that deletes disks"
# Continue the conversation that built the flow, answering its clarifying question.
dci refine-cloud-flow <flow-id> question: "Use the finance-reports dataset", conversationId: <conversation-id>
# A longer instruction read from a file (free text with commas must go through stdin).
dci refine-cloud-flow <flow-id> < refine.json
# refine.json
{"question": "Rename the flow to Weekly AWS spend to DataHub, change the schedule to Fridays at 17:00 UTC, and post the run link to Slack when it finishes."}
Request
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
question | string | yes | Natural language description of what to refine or modify in the CloudFlow. |
conversationId | string | ID of an existing conversation to continue. When omitted, a new conversation is started. |
Raw JSON schema
{
"type": "object",
"required": [
"question"
],
"properties": {
"question": {
"type": "string",
"description": "Natural language description of what to refine or modify in the CloudFlow."
},
"conversationId": {
"type": "string",
"description": "ID of an existing conversation to continue. When omitted, a new conversation is started."
}
}
}
Output
OK - Refine event stream.
By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.
Returns: string
Raw JSON schema
{
"type": "string"
}
Errors
On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.
HTTP status to exit code mapping
| HTTP status | Exit code | Error code | Meaning |
|---|---|---|---|
| 400 | 30 | VALIDATION_ERROR | The arguments or request body were rejected. Review the command's flags and payload. |
| 401 | 10 | AUTHENTICATION_FAILED | Not signed in, or the API token is invalid. Run dci login or check DCI_API_KEY. |
| 403 | 11 | PERMISSION_DENIED | The DoiT user or the active customer context does not have access. |
| 406 | 1 | API_ERROR | The request failed; the printed error message has details. |
| 500, 502 | 40 | API_SERVER_ERROR | The API failed to process the request. Retryable; contact DoiT support if it persists. |
Related
- build-cloud-flow — Build a new CloudFlow from scratch
- export-cloudflow-flow — Export a flow as a portable bundle
- import-cloudflow-flow — Import a flow bundle
- test-run-cloudflow-flow — Test-run a flow
- list-cloudflows — List CloudFlows
- API reference: POST /cloudflow/v1/flows/{flowId}/actions/refine
Aliases: refinecloudflow