Flow

Deploy a new flow

POST
/flows:deploy

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}.

BearerAuth
headerAuthorizationBearer <JWT>

Admin token, API token issued via /api-tokens, or an OIDC JWT access token issued by the configured OIDC provider.

multipart/form-data
  1. body
metadata*

Metadata for the metadata part of the multipart upload.

bundle?unknown

The flow tarball (.tar.gz), optional.

Response Body

The deploy, PENDING with a bundle and SUCCEEDED without.

application/json
  1. response

A deploy of a flow: of a bundle, which is indexed before it goes live, or of a new flow without one.

name*string

Unique resource name.

flow*string

The flow deployed to. For a new flow's deploy, the flow it creates once it succeeds; until then the flow doesn't exist.

state*string

PENDING 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.

Value in"PENDING""SUCCEEDED""FAILED""SUPERSEDED"
error?

Why a deploy failed.

createTime*string

Time at which the deploy was started.

Formatdate-time
updateTime*string

Time at which the deploy last changed state.

Formatdate-time
Example Request
curl -X POST 'https://example.com/api/hub/flows:deploy' \  -F 'metadata={  "displayName": "Data Ingestion Pipeline"}'
Example Response
{  "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"}