Docs menu

Run flow from step

POST /v1/organisations/{organisation_id}/spaces/{space_id}/flow-runs/{run_id}/from

Run from here (flow-paths-design §8 phase 4): a new run of the same version that reuses the outputs of the steps before step_id from this run, without doing their work again.

Authentication

Send an API key, or an access token from your organisation’s identity provider, in the Authorization header. How API keys work

Any API key can call this operation; it needs no scope.

Security schemes in the OpenAPI document: session_cookie (cookie __Host-ivy_session)bearer (bearer)api_key (bearer)

Parameters

  • organisation_id path string required
  • space_id path string required
  • run_id path string required

Request body

application/json RunFromStep required

  • step_id string required

    The step the new run starts at; the steps it runs after are reused.

Responses

  • 202 application/json FlowRunAccepted

    The new run started: the steps before the chosen one are reused from the run, the rest run again

  • 401 application/json ErrorBody

    unauthenticated

  • 403 application/json ErrorBody

    run_content_hidden: you may see only that the run ran; not_your_run: it acts as the person who started it; insufficient_scope, workspace_content_restricted, forbidden

  • 404 application/json ErrorBody

    No such run you may know of, no such step, or flows or paths are off

  • 409 application/json ErrorBody

    run_in_progress; test_run: test runs start again from the editor; cannot_run_from_here: a step before it didn't finish; run_from_version_changed: the flow has another active version; run_from_reused_erased: what a step to reuse did, or the run's input, was erased; run_from_changed_inputs: the trigger's file, or a file a step to reuse read, has a newer version; input_missing: a file the run read or a step to reuse saved is being deleted; busy; workflow_inactive: the flow was switched off while the run started; workspace_archived; on the three run_from_… codes and input_missing, run it again from the start

  • 429 application/json ErrorBody

    rate_limited: the API key's requests per minute are used up; retry after Retry-After seconds

  • 500 application/json ErrorBody

    internal

  • 503 application/json ErrorBody

    unavailable: the database is briefly unavailable; retry after Retry-After seconds

Error codes

Errors come back as an ErrorBody whose code is one of these.

  • 401 unauthenticated
  • 403 run_content_hiddennot_your_runinsufficient_scopeworkspace_content_restrictedforbidden
  • 404 not_found generic code for this status
  • 409 run_in_progresstest_runcannot_run_from_hererun_from_version_changedrun_from_reused_erasedrun_from_changed_inputsinput_missingbusyworkflow_inactiveworkspace_archived
  • 429 rate_limited
  • 500 internal
  • 503 unavailable

Examples

curl
curl -X POST "$IVY_API_URL/v1/organisations/$ORGANISATION_ID/spaces/$SPACE_ID/flow-runs/$RUN_ID/from" \
  -H "Authorization: Bearer $IVY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"step_id":"step_123"}'
JavaScript SDK
import { client, runFlowFromStep } from "@spacivapp/ivy-sdk";

client.setConfig({
  baseUrl: process.env.IVY_API_URL,
  headers: { Authorization: `Bearer ${process.env.IVY_API_KEY}` },
});

const { data, error, response } = await runFlowFromStep({
  path: { organisation_id: organisationId, space_id: spaceId, run_id: runId },
  body: {
    step_id: "step_123"
  },
});
Example request body
{
  "step_id": "step_123"
}
Example response (202)
{
  "existing": false,
  "outcome": "string",
  "reason": "string",
  "run_id": "run_123"
}