Create flows

Creates an automation and its initial DRAFT version in one call.

POST /v1/auto/flows

Addresshttps://api.hanzo.ai/v1/auto/flows
MethodPOST
Operationpost_auto_flows
AuthAuthorization: Bearer $HANZO_API_KEY

Creates an automation and its initial DRAFT version in one call. The new flow is DISABLED — creating it does not arm its trigger; POST /v1/auto/flows/{id}/enable does that.

Request

30 fields, body application/json (required).

FieldInTypeRequiredDescription
displayNamebodystring—DisplayName names the flow's initial draft version.
externalIdbodystring—ExternalID is the caller's own id for this flow.
folderIdbodystring—FolderID groups the flow in the builder's tree.
triggerbodyauto.FlowTrigger—
trigger.displayNamebodystring—
trigger.namebodystring—
trigger.nextActionbodyauto.FlowAction—
trigger.nextAction.displayNamebodystring—
trigger.nextAction.namebodystring—
trigger.nextAction.nextActionbodyauto.FlowAction—
trigger.nextAction.settingsbodyauto.StepSettings—
trigger.nextAction.settings.actionNamebodystring—
trigger.nextAction.settings.inputbodyobject—
trigger.nextAction.settings.input.*bodyany—
trigger.nextAction.settings.pieceNamebodystring—
trigger.nextAction.settings.pieceVersionbodystring—
trigger.nextAction.settings.triggerNamebodystring—
trigger.nextAction.skipbodyboolean—
trigger.nextAction.typebodystring—PIECE | CODE | ROUTER | LOOP_ON_ITEMS
trigger.nextAction.validbodyboolean—
trigger.settingsbodyauto.StepSettings—
trigger.settings.actionNamebodystring—
trigger.settings.inputbodyobject—
trigger.settings.input.*bodyany—
trigger.settings.pieceNamebodystring—
trigger.settings.pieceVersionbodystring—
trigger.settings.triggerNamebodystring—
trigger.strategybodystring—
trigger.typebodystring—PIECE_TRIGGER | EMPTY
trigger.validbodyboolean—

Response

StatusBodyMeaning
201auto.populatedFlowcreated
defaultproblem-detailsrefused

201 body — 45 fields.

FieldInTypeAlwaysDescription
createdbodyinteger (int64)—Created and Updated are unix milliseconds.
externalIdbodystring—ExternalID is the caller's own id for this flow, if it set one.
folderIdbodystring—FolderID groups the flow in the builder's tree.
idbodystring—ID is the flow's id.
metadatabodyany—Metadata is the caller's opaque JSON, stored and returned verbatim.
projectIdbodystring—Org is the owning org, which this surface names projectId.
publishedVersionIdbodystring—PublishedVersionID is the version a run executes when set; empty means the latest version runs.
statusbodystring—Status is ENABLED or DISABLED — whether the flow's trigger is armed.
updatedbodyinteger (int64)—
versionbodyauto.FlowVersion—
version.createdbodyinteger (int64)—
version.displayNamebodystring—
version.flowIdbodystring—
version.idbodystring—
version.schemaVersionbodystring—
version.statebodystring—
version.triggerbodyauto.FlowTrigger—
version.trigger.displayNamebodystring—
version.trigger.namebodystring—
version.trigger.nextActionbodyauto.FlowAction—
version.trigger.nextAction.displayNamebodystring—
version.trigger.nextAction.namebodystring—
version.trigger.nextAction.nextActionbodyauto.FlowAction—
version.trigger.nextAction.settingsbodyauto.StepSettings—
version.trigger.nextAction.settings.actionNamebodystring—
version.trigger.nextAction.settings.inputbodyobject—
version.trigger.nextAction.settings.input.*bodyany—
version.trigger.nextAction.settings.pieceNamebodystring—
version.trigger.nextAction.settings.pieceVersionbodystring—
version.trigger.nextAction.settings.triggerNamebodystring—
version.trigger.nextAction.skipbodyboolean—
version.trigger.nextAction.typebodystring—PIECE | CODE | ROUTER | LOOP_ON_ITEMS
version.trigger.nextAction.validbodyboolean—
version.trigger.settingsbodyauto.StepSettings—
version.trigger.settings.actionNamebodystring—
version.trigger.settings.inputbodyobject—
version.trigger.settings.input.*bodyany—
version.trigger.settings.pieceNamebodystring—
version.trigger.settings.pieceVersionbodystring—
version.trigger.settings.triggerNamebodystring—
version.trigger.strategybodystring—
version.trigger.typebodystring—PIECE_TRIGGER | EMPTY
version.trigger.validbodyboolean—
version.updatedbodyinteger (int64)—
version.validbodyboolean—

Failure carries the platform error shape — see Errors.

Examples

hanzo auto flows create
import { Configuration, AutoApi } from 'hanzoai';

const api = new AutoApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postAutoFlows({ displayName: "<displayName>", externalId: "<externalId>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AutoApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AutoApi(client).post_auto_flows(display_name="<displayName>", external_id="<externalId>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AutoAPI.PostAutoFlows(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, auto_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = auto_api::post_auto_flows(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AutoApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new AutoApi(client).postAutoFlows();
curl -X POST https://api.hanzo.ai/v1/auto/flows \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "displayName": "<displayName>",
       "externalId": "<externalId>"
     }'

MCP reaches auto through the auto tool, which names its 14 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_auto_flows"
         }
       }
     }'

Auto API · All Hanzo APIs · Interactive reference

Was this page useful?