Move workflows to another connection
POST/
Moves every workflow from this connection to another of the same app.
Needs an API token with the Write permission for connections (connection:write).
Parameters
Path
idRequired · UUIDThe connection to move workflows away from.
Body
targetIdRequired · UUIDThe connection to move them to: another one, of the same app, in this workspace.
workflowIdsOptional · array of UUIDsOnly these workflows, up to 500. Moving the answer’s
workflowIdsback undoes it exactly.
What moves
Every reference in each workflow’s draft and its stored versions: triggers, steps, branches, loops and error steps. alsoOnTarget names workflows that already used the target too; moving them back moves those steps as well.
Neither connection is deleted. Sending it again finds nothing left and answers 0, so it needs no Idempotency-Key. Then delete the old one if you like.
Responses
- 200OK
How many workflows moved, and which. 0 is fine: nothing used it.
An ID isn’t a UUID, the body isn’t JSON, the two are the same connection, or they are for different apps.
- 403
FORBIDDENThe token lacks the Write permission for connections.
- 404
NOT_FOUNDThe connection or the target isn’t in this workspace.
Nothing moved. Try again.
Any call can also answer: 401 UNAUTHORIZED · 401 TOKEN_ENDED · 403 TOKEN_SURFACE_OFF · 403 FEATURE_OFF · 403 EMBED_NOT_ALLOWED · 403 EMBED_NOT_AVAILABLE · 403 ACCOUNT_SUSPENDED · 413 PAYLOAD_TOO_LARGE · 415 INVALID_CONTENT_TYPE · 429 RATE_LIMITED · 503 BUSY · 503 PAUSED · 503 SERVICE_UNAVAILABLE. See Errors.
Request
GORUNNER="https://api.gorunner.io"
GORUNNER_TOKEN="grt_…" # needs Write for connections
CONNECTION_ID="your-connection-id"
URL="$GORUNNER/api/connections/$CONNECTION_ID/"
URL="${URL}replace"
curl -X POST "$URL" \
-H "Authorization: Bearer $GORUNNER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"targetId": "8c7d6e5f-4a3b-2c1d-0e9f-8a7b6c5d4e3f"
}'const GORUNNER = "https://api.gorunner.io";
const TOKEN = process.env.GORUNNER_TOKEN;
const CONNECTION_ID = process.env.CONNECTION_ID;
const res = await fetch(
`${GORUNNER}/api/connections/` +
`${CONNECTION_ID}/replace`,
{
method: "POST",
headers: {
Authorization: `Bearer ${TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
targetId: "8c7d6e5f-4a3b-2c1d-0e9f-8a7b6c5d4e3f",
}),
},
);
const { data } = await res.json();import os, requests
GORUNNER = "https://api.gorunner.io"
TOKEN = os.environ["GORUNNER_TOKEN"]
CONNECTION_ID = os.environ["CONNECTION_ID"]
res = requests.post(
f"{GORUNNER}/api/connections/{CONNECTION_ID}/"
f"replace",
headers={"Authorization": f"Bearer {TOKEN}"},
json={
"targetId": "8c7d6e5f-4a3b-2c1d-0e9f-8a7b6c5d4e3f",
},
)
data = res.json()["data"]Response · 200 OK
{
"data": {
"updated": 3,
"workflowIds": [
"3b1e5c2a-7d4f-4e8b-a1c6-5f2d9b0e7a31",
"6e9a1c3f-8b2d-4a57-9e0c-3f7b5d1a8c42",
"…"
],
"alsoOnTarget": []
}
}Every field
Body
targetIdRequired · UUIDThe connection to repoint references to. Must exist in the same workspace, must differ from the path id, and must have the SAME
pieceIdas the source.workflowIdsOptional · array of UUIDsMove only these workflows (their drafts and every version). The answer’s
workflowIdsmoved back the other way is an exact Undo.
Response · 200 OK
dataobjectupdatedintegerHow many workflows were moved (drafts and every stored version, counted once per workflow).
workflowIdsarray of UUIDsThe workflows moved.
alsoOnTargetarray of UUIDsMoved workflows that already named the target before: moving them back moves those steps too.