Deploy a new flow
Deploys a new flow from a multipart upload containing metadata and, optionally, a tarball (.tar.gz), and returns the deploy.
With a bundle, the deploy is PENDING while the bundle is indexed (Flux's function index and each file's blocks), and the flow is created only when that succeeds: GET /deploys/{deploy}/events streams its progress and ends with it SUCCEEDED, or FAILED with the reason, in which case no flow is created. Without one, the flow is created at once (SUCCEEDED) with no bundle and an empty function index; it can't run until a bundle is uploaded with PATCH /flows/{flow}.
BearerAuthAuthorizationBearer <JWT>Admin token, API token issued via /api-tokens, or an OIDC JWT access token issued by the configured OIDC provider.
multipart/form-data- body
metadata*Metadata for the metadata part of the multipart upload.
bundle?unknownThe flow tarball (.tar.gz), optional.
The deploy, PENDING with a bundle and SUCCEEDED without.
application/json- response
A deploy of a flow: of a bundle, which is indexed before it goes live, or of a new flow without one.
name*stringUnique resource name.
flow*stringThe flow deployed to. For a new flow's deploy, the flow it creates once it succeeds; until then the flow doesn't exist.
state*stringPENDING while the bundle is indexed; SUCCEEDED once the flow runs it; FAILED with error, leaving the flow as it was (a new flow is not created); SUPERSEDED when a newer deploy of the same flow, or its deletion, came first.
"PENDING""SUCCEEDED""FAILED""SUPERSEDED"error?Why a deploy failed.
createTime*stringTime at which the deploy was started.
date-timeupdateTime*stringTime at which the deploy last changed state.
date-timecurl -X POST 'https://example.com/api/hub/flows:deploy' \ -F 'metadata={ "displayName": "Data Ingestion Pipeline"}'{ "name": "deploys/0190f5a2-7c3e-7b1a-9d4e-2f6a8b0c1d3e", "flow": "flows/550e8400-e29b-41d4-a716-446655440000", "state": "PENDING", "error": { "reason": "INVALID_BUNDLE", "message": "Syntax error in src/index.ts: Variable declaration expected.", "fluxCode": "parse", "file": "src/index.ts", "range": {} }, "createTime": "2019-08-24T14:15:22Z", "updateTime": "2019-08-24T14:15:22Z"}