Flow Deployment

Tables

There are two tables you need to know about: flow_deployments and flow_deployment_tags.

flow_deployments

flow_deployments table

Read-only columns: we don't enforce column-level permissions at the moment, updating these column will cause problems.

  • id: ID of the deployment, we use UUIDv7, therefore we can sort deployments by ID and the result will be ordered by creation time.

  • created_at

  • user_id: owner of the deployment.

  • entrypoint: Flow ID, the main flow of this deployment, when starting the deployment, this flow will be called.

Customizable columns: update these columns to change the behavior of the deployment

  • start_permission: specify who can call this deployment, this column replace is_public, start_shared, start_unverified columns of flows table. Possible values:

    • "Owner": only owner of the deployment.

    • "Authenticated": any authenticated user.

    • "Anonymous": unauthenticated user (start_flow_unverified).

    Default value will be inferred from flow config.

  • output_instructions: (true/false) if set to true, will stop flow and return the transaction when available. Default is false.

  • action_identity: (public key) When set, will append an Action Identity memo to instructions. Deployment owner must also have a hard-coded wallet with this public key. Default: null.

  • fees: specify address and amount to send fee to. Default: empty list. Example:

  • solana_network: Solana cluster and RPC URL. Default: same as flow config. Example:

flow_deployments_tags

Tags allow calling flow deployments in a human-friendly way.

A "latest" tag will be created automatically and point to the latest deployment of a flow.

API Authentication

All examples will need authentication headers, using one of the methods below. I will omit them for brevity.

Using access token:

Using API key:

Unauthenticated user, using public key (like in start_flow_unverified):

Deploy a flow

Request:

Only owner of flow can deploy.

Response:

Inserted row in flow_deployments table:

Inserted row in flow_deployments_tags table:

Call a deployment

We unify /start, /start_shared, /start_unverified into only one /deployment/start route. It depends on which user is calling:

  • If it is the owner, behavior is same as /start

  • If it is another user, behavior is same as /start_shared

  • If it is an unauthenticated user, /start_unverified

Column start_permission will decide which users can call the deployment. Note: if the wrong user is calling, it will return a "404 not found" error instead of a permission error.

You can specify deployment either by ID or by flow ID and tag.

Call via ID:

Call via flow ID and tag:

If you don't specify tag, default "latest" tag will be used:

JSON request body:

Example body:

Response: same as start flow response

You can query flow_run of a deployment using the new flow_run.deployment_id column:

Normal flow_run will have deployment_id set to null.

Last updated

Was this helpful?