---
title: "Fork a workflow revision into a draft and recompile it"
method: POST
path: "/v1/workflows/revisions/{revision_id}/recompile"
tags: ["workflows"]
---

# Fork a workflow revision into a draft and recompile it

`POST /v1/workflows/revisions/{revision_id}/recompile`

Recompile a (possibly published) revision without mutating it.

The active/published revision is immutable — the runtime reads its graph live —
so this forks the source into a fresh DRAFT, force-compiles the draft, and
returns it (HTTP 202). Poll ``GET /workflows/revisions/{revision.id}``; promote
the draft via ``set-active-revision`` once the recompile lands and is reviewed.

## Path parameters

- `revision_id` string, uuid, required

## Request body

- RecompileWorkflowRequest — Body for ``POST /workflows/revisions/{id}/recompile``. Recompile = fork the (typically frozen/published) source revision into a fresh draft and force-compile the draft. ``name`` overrides the auto-generated draft name; ``compilation_strategy`` overrides the strategy carried from the source.
  - `compilation_strategy` string, nullable
  - `name` string, nullable

## Response `202`

Successful Response

- WorkflowRecompileResponse — Result of a recompile (fork-then-compile). ``revision`` is a NEW draft revision forked from ``source_revision_id`` and is being compiled (always HTTP 202 — a recompile always forces). Poll ``GET /workflows/revisions/{revision.id}`` for the result. The source revision is never mutated; promote the draft via ``set-active-revision`` when ready.
  - `status` string, required
  - `task_id` string, nullable
  - `source_revision_id` string, uuid, required
  - `revision` WorkflowRevisionResponse, required — Full revision response — the compile-poll target (WF-08). Clients poll GET /workflows/revisions/{id} and read ``compilation_status`` + ``compilation_errors`` + ``compiled_graph`` to determine whether an async compile job is done. ``compilation_task_id`` is the Celery task handle the conductor uses to cancel an in-flight compile.
    - `id` string, uuid, required
    - `workflow_id` string, uuid, required
    - `name` string, required
    - `description` string, nullable
    - `instructions` string, required
    - `system_prompt` string, nullable
    - `compiled_graph` object, nullable
    - `quality_report` object, nullable
    - `compilation_errors` string[], nullable
    - `compilation_strategy` string, required
    - `compilation_status` string, required
    - `compilation_task_id` string, nullable
    - `compilation_input_hash` string, nullable
    - `trigger_type` string, required
    - `trigger_config` object, required
    - `router_config_id` string, uuid, nullable
    - `analyzer_model_settings` ModelChainEntry
      - `model` string, required
      - `config` ModelConfig
        - `temperature` number, nullable
        - `max_tokens` integer, nullable
        - `top_p` number, nullable
        - `stop_sequences` string[], nullable
        - `reasoning_effort` 'none' | 'low' | 'medium' | 'high' | 'xhigh', nullable
        - `request_timeout_ms` integer, nullable
        - `thinking_budget` integer, nullable
    - `router_model_settings` ModelChainEntry
      - `model` string, required
      - `config` ModelConfig
        - `temperature` number, nullable
        - `max_tokens` integer, nullable
        - `top_p` number, nullable
        - `stop_sequences` string[], nullable
        - `reasoning_effort` 'none' | 'low' | 'medium' | 'high' | 'xhigh', nullable
        - `request_timeout_ms` integer, nullable
        - `thinking_budget` integer, nullable
    - `policy_ids` unknown[]
      - unknown
    - `tool_input_defaults` object, nullable
    - `tools` WorkflowToolResponse[]
      - `tool` ToolResponse, required
        - `id` string, uuid, required
        - `organization_id` string, uuid, required
        - `name` string, required
        - `description` string, nullable, required
        - `tool_type` 'api_call' | 'call_transfer', required
        - `active_revision_id` string, uuid, nullable, required
        - `active_revision` ToolRevisionResponse
          - `id` string, uuid, required
          - `tool_id` string, uuid, required
          - `name` string, required
          - `description` string, nullable, required
          - `configuration` APICallConfiguration — Configuration for an API_CALL tool, stored in Tool.configuration. Supports ``{{variable}}`` placeholders in url, headers, and body that are resolved at execution time from the tool's input variables and runtime metadata (via ``{{metadata.key}}``).
            - `url` string, required — API endpoint URL — supports {{variable}} placeholders
            - `method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
            - `headers` HeaderConfig[]
              - …
            - `query_params` QueryParamConfig[]
              - …
            - `body` object
            - `timeout` integer — Request timeout in seconds
            - `variables` VariableDefinition[]
              - …
            - `retry` RetryConfig — Retry configuration — same schema at org, tool, and integration-instance level.
              - …
          - `transfer_target` TransferTargetView — A call_transfer revision's stored target, surfaced on reads. ``ToolRevisionResponse.configuration`` is api_call-typed and parses to ``None`` for a transfer config (it has no ``url``), so this field carries the destination/mode back for the transfer-target picker. ``label`` / ``when_to_use`` come from the parent Tool's ``name`` / ``description``.
            - `destination` string, required
            - `mode` 'cold' | 'warm'
          - `response_schema` ResponseFieldSelector — Defines which fields to extract from a tool response.
            - `field_mappings` ResponseFieldMapping[]
              - …
          - `status` string, required
          - `has_secrets` boolean
          - `input_defaults` object, nullable
          - `created_by` string, nullable, required
          - `created_at` string, date-time, required
          - `updated_at` string, date-time, required
          - `default_count` integer, required — How many input variables carry an operator *default* (ENG-590).
          - `pinned_count` integer, required — How many input variables are operator-*pinned* (ENG-590).
          - `stale_input_fields` string[], required — Configured variables removed/renamed/retyped by an operator edit.
          - `merged_input_preview` object, required — The input schema with each operator value injected as ``default``.
        - `metadata` object
        - `created_at` string, date-time, required
        - `updated_at` string, date-time, required
      - `tool_revision_id` string, uuid, nullable
    - `knowledge_base_ids` string[]
    - `created_by` string, nullable
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `400` — Bad request
- `401` — Authentication required
- `422` — Validation Error

---

[API](https://skmtc.net/oneloop-hq/apis/feather-api.md) · [All operations](https://skmtc.net/oneloop-hq/apis/feather-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/oneloop-hq/feather-api/versions/888bdd5c076e/schema)
