Import a workflow from an export envelope
workflow:writeCreates a new DRAFT workflow from the JSON that GET /api/workflows/{id}/export produces. The import is never activated and never reuses the exporter's identity: a new id is assigned, and any webhook token inside the definition is stripped and re-minted, so the imported copy cannot receive traffic on the original's URL — and stays inert until you publish it.
The body may be the full export envelope ({"gorunnerExport":"workflow","version":1,"workflow":{…}}) or the bare {name, description, triggerType, tags, definition} object — the envelope is tried first and the bare form is the fallback. Bodies are read up to 5 MB.
Unlike POST /api/workflows, import ALWAYS validates every piece and action reference against the live worker fleet: a definition naming a piece this instance cannot run is refused with 422 rather than stored. Steps that do not name a pieceVersion are pinned to the version the fleet currently serves. Structural completeness is NOT required — an in-progress export with an unset trigger imports fine as an editable draft. Connection ids inside the definition are environment-specific and are carried across verbatim; re-point them yourself after importing.
Authorization
bearerAuth An API token: Authorization: Bearer grt_…. Mint one in the app under Settings → Workspace → API tokens; the raw value is shown once. Scopes confine the token — see x-permission on each operation.
In: header
Header Parameters
Opt-in replay protection, max 255 characters. A retry with the same key replays the original response (Idempotency-Replayed: true) instead of importing a second copy. Reusing the key with a different body returns 422; while the first request is still running it returns 409. Records are kept 24 hours.
length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
The portable file format produced by the export route and accepted by import. Carries no ids, no status, no folder, no webhook token and no run history — only what is meaningful on another instance.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/workflows/import" \ -H "Content-Type: application/json" \ -d '{ "gorunnerExport": "workflow", "version": 1, "workflow": { "definition": { "schemaVersion": 2, "trigger": { "name": "string", "type": "manual", "config": {} } } } }'{ "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "description": "string", "definition": { "schemaVersion": 2, "trigger": { "name": "string", "displayName": "string", "type": "manual", "pieceId": "string", "pieceVersion": "string", "actionId": "string", "config": {}, "connectionId": "string", "valid": true, "nextAction": { "name": "string", "displayName": "string", "type": "PIECE", "pieceId": "string", "pieceVersion": "string", "actionId": "string", "config": {}, "connectionId": "string", "valid": true, "skip": true, "nextAction": {}, "branches": [ { "name": "string", "conditions": [ [ { "field": "string", "operator": "text_eq", "value": null } ] ], "firstAction": {} } ], "firstLoopAction": {}, "onErrorAction": {} } }, "settings": { "timeoutSeconds": 0, "errorWorkflowId": "51d8ee47-3646-4ae6-bc48-c85415c9166a", "concurrencyLimit": 0, "maintenanceMode": true, "autoPublishFixes": true }, "annotations": null, "variables": {}, "pinnedData": {} }, "status": "draft", "triggerType": "manual", "cronExpression": "string", "webhookToken": "string", "latestVersionId": "750445c5-7ad9-40bd-a593-bb37d7d846db", "definitionRev": 0, "hasUnpublishedChanges": true, "folderId": "5b6379a4-2a6c-4085-b184-45838a3b8e7e", "tags": [ "string" ], "testPayloads": {}, "pinnedData": {}, "workspaceId": "ef0efa32-d1c1-43d4-a5e2-fe7b4f00403c", "orgId": "25b2c2d5-a7fc-47d0-89e4-8709a1560bfa", "createdBy": "25a02396-1048-48f9-bf93-102d2fb7895e", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "lastRun": { "status": "pending", "startedAt": "2019-08-24T14:15:22Z" } }}