Skip to content

Handler: clone the repo, scan it, apply the plan, return the report.

POST
/api/workflows/import/windmill/repo
curl --request POST \
--url https://example.com/api/workflows/import/windmill/repo \
--header 'Content-Type: application/json' \
--cookie supacloud_session=<supacloud_session> \
--data '{ "credential_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "db_resource": "example", "git_ref": "example", "git_url": "example", "project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Handler: clone the repo, scan it, apply the plan, return the report.

Media typeapplication/json

POST /api/workflows/import/windmill/repo body.

object
credential_id

Optional git_credentials row id (an access_token credential) whose token is the HTTPS PAT used for the clone. DB-backed + workspace-pickable, so it works on the env-only secret backend. Omit for a public repo.

string | null format: uuid
db_resource

Optional postgresql resources row (by NAME or UUID) the repo’s shared db namespace (db/migrations/) binds to (ADR 0057). This is the one deployment-specific fact a generic windmill repo can’t carry — picked in the wizard — so it binds the INFERRED namespace and overrides any repo-authored db/namespace.yaml resource. Omit when the repo has no db/migrations/, or carries a self-contained db/namespace.yaml.

string | null
git_ref

Branch to clone. Defaults to main when omitted.

string | null
git_url
required

HTTPS clone URL of the windmill-workflows repo.

string
project_id
required

The project the imported workflows are created in.

string format: uuid

Example generated

{
"credential_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"db_resource": "example",
"git_ref": "example",
"git_url": "example",
"project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Per-flow import report

Media typeapplication/json

The full result of applying an ImportPlan to a project.

object
blocked
required

Flows the scanner could not convert (surfaced through from the plan).

Array<object>

A flow the scanner could not convert at all (surfaced straight through from ImportPlan::blocked so the operator sees the whole picture in one report).

object
reason
required
string
source_path
required
string
db_namespace
One of:

The shared db namespace (db/namespace.yaml + db/migrations/) result, when the repo ships one on a BYO DEDICATED postgresql resource (ADR 0057). None when there is no namespace OR when the import bound the built-in App DB (that path is per-App — see per_app_db).

object
applied
required

Migration names actually applied to the schema this run.

Array<string>
failed
required

Per-step failures (resource/namespace resolution, a bad migration, apply).

Array<object>

One migration (or resolution step) that failed during a namespace import.

object
name
required
string
reason
required
string
handle
required

The namespace handle from the manifest.

string
namespace_id
required

The namespace row id (nil if resolution failed before creation).

string format: uuid
recorded
required

Migration names recorded into db_namespace_migrations.

Array<string>
schema
required

The resolved schema name (the manifest’s schema, else the handle).

string
detected_apps
required

Incomplete raw-App imports; an App row can exist after a source-file write failure.

Array<object>

An incomplete raw-App import: an existing slug or a creation/source-file failure. An App row can exist when a subsequent file write fails. Carries the operator note and reason.

object
name
required
string
note
required
string
reason
required
string
source_path
required
string
detected_http_triggers
required

HTTP triggers detected — DETECT-only, the operator re-wires them.

Array<object>

A generic DETECT-and-record item (HTTP trigger / schedule) the operator must re-wire by hand — SupaCloud has no 1:1 import for these.

object
name
required
string
note
required
string
source_path
required
string
detected_schedules
required

Schedules detected — DETECT-only, the operator re-creates them.

Array<object>

A generic DETECT-and-record item (HTTP trigger / schedule) the operator must re-wire by hand — SupaCloud has no 1:1 import for these.

object
name
required
string
note
required
string
source_path
required
string
failed
required

Flows that converted but failed to persist (one bad flow, rest continue).

Array<object>

A flow that converted but failed to persist (a per-flow error — the rest of the plan still imports). Distinct from the scanner’s blocked (failed to convert).

object
reason
required
string
source_path
required
string
imported
required

Flows that persisted as new workflows.

Array<object>

One flow that persisted into the project.

object
fidelity
required

The scanner’s fidelity badge, as a stable lowercase label (clean | needs_rebind | blocked) — keeps the report serializable without making the internal Fidelity enum Serialize.

string
name
required
string
source_path
required
string
warnings
required
Array<string>
workflow_id
required
string format: uuid
imported_apps
required

Raw-apps that persisted as React Apps.

Array<object>

A raw-app that persisted as a SupaCloud App (framework = react).

object
app_id
required
string format: uuid
file_count
required

Number of source files written into the App’s app_files tree.

integer
name
required
string
source_path
required
string
imported_scripts
required

First-class scripts imported as SupaCloud Script rows (never dropped).

Array<object>

A first-class Windmill script imported as a SupaCloud Script row. Carries the LOUD needs_mapping review notes (windmill APIs the source uses that must be adapted before it runs on the substrate) — the importer surfaces the script, it never silently drops it.

object
name
required

The display name the Script row was created with.

string
needs_mapping
required

Windmill-specific APIs to adapt before the script runs (empty ⇒ none flagged).

Array<string>
script_id
required

The created Script row id.

string format: uuid
source_path
required

The windmill script path (f/shared/finance_overview).

string
needs_mapping
required

Custom resource types an operator must wire (not auto-created).

Array<object>

A custom resource type the operator must wire to a SupaCloud resource/credential before its flows can run. We never auto-create credentials, so each resource type is surfaced here, not applied.

object
name
required
string
source_path
required
string
per_app_db
required

The per-App installs of the repo’s shared schema into each imported App’s own app_<id> schema (#626 §14 — the built-in App DB path). Empty unless the import bound the built-in App DB and the repo ships db/migrations/.

Array<object>

The result of installing a repo’s shared schema into ONE imported App’s own per-App app_<id> schema (built-in App DB path).

object
app_id
required

The App the schema was installed into.

string format: uuid
app_name
required

The App’s display name (echoed for the report).

string
applied
required

Migration names newly applied into this App’s schema this run.

Array<string>
failed
required

Per-migration failures (a failure blocks the rest — append-only migrations are ordered, so a mid-set failure would mis-attribute if we continued).

Array<object>

One migration (or resolution step) that failed during a namespace import.

object
name
required
string
reason
required
string
schema
required

The per-App schema the repo migrations were applied to (app_<id>); empty only when the very first migration failed before any apply resolved it.

string
plan_warnings
required

Repo-level warnings the SCAN produced that are not attributable to a single flow (a malformed resource-type file, a skipped raw-app, a db-namespace note, a cross-flow resource/env-var collision).

The report retains every scanner warning, including cross-tenant collisions, independently of per-flow results. Scanner ordering is deterministic.

Array<string>
skipped
required

Flows skipped because a same-named workflow already exists in the project.

Array<object>

A flow skipped because a workflow with the same name already exists in the project (idempotent re-import — cheap skip-by-name, no duplicate row).

object
name
required
string
reason
required
string
source_path
required
string
skipped_scripts
required

First-class scripts detected but not imported (idempotent same-slug skip / unsupported-language create error) — surfaced, never silently dropped.

Array<object>

A first-class script detected but NOT imported — an idempotent same-slug skip on re-import, or a create error (e.g. a language not yet supported as a standalone Script). Surfaced so the operator sees it; NEVER silently dropped.

object
name
required
string
reason
required
string
source_path
required
string

Example generated

{
"blocked": [
{
"reason": "example",
"source_path": "example"
}
],
"db_namespace": {
"applied": [
"example"
],
"failed": [
{
"name": "example",
"reason": "example"
}
],
"handle": "example",
"namespace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"recorded": [
"example"
],
"schema": "example"
},
"detected_apps": [
{
"name": "example",
"note": "example",
"reason": "example",
"source_path": "example"
}
],
"detected_http_triggers": [
{
"name": "example",
"note": "example",
"source_path": "example"
}
],
"detected_schedules": [
{
"name": "example",
"note": "example",
"source_path": "example"
}
],
"failed": [
{
"reason": "example",
"source_path": "example"
}
],
"imported": [
{
"fidelity": "example",
"name": "example",
"source_path": "example",
"warnings": [
"example"
],
"workflow_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}
],
"imported_apps": [
{
"app_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"file_count": 1,
"name": "example",
"source_path": "example"
}
],
"imported_scripts": [
{
"name": "example",
"needs_mapping": [
"example"
],
"script_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"source_path": "example"
}
],
"needs_mapping": [
{
"name": "example",
"source_path": "example"
}
],
"per_app_db": [
{
"app_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"app_name": "example",
"applied": [
"example"
],
"failed": [
{
"name": "example",
"reason": "example"
}
],
"schema": "example"
}
],
"plan_warnings": [
"example"
],
"skipped": [
{
"name": "example",
"reason": "example",
"source_path": "example"
}
],
"skipped_scripts": [
{
"name": "example",
"reason": "example",
"source_path": "example"
}
]
}

Structured client error

Media typeapplication/json

The canonical JSON body of every error response. Every AppError serializes as this exact shape; code is the generated stable machine-readable vocabulary.

object
cap
One of:

Present only on an MCP budget refusal (429) — the refusing layer + retry hint.

object
layer
required

The refusing layer.

string
limit
required

The layer’s budget.

integer format: int64
retry_after_seconds

Seconds until a retry can pass, or null when it never will for this session.

integer | null format: int64
used
required

Calls already counted in the layer.

integer format: int64
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired fresh_auth_required source_not_released bad_request unprocessable precondition_failed conflict artifact_staging_busy artifact_staging_store_unavailable intervention_attachment_limit method_not_allowed rate_limited too_many_requests quota_exceeded mcp_cap_exceeded form_schema_invalid autosave_not_offered submit_not_offered idempotency_key_reused response_cap_reached required_missing database_error docker_error vault_error internal_error artifact_frames_unavailable identity_native_custody_unconfigured launch_concurrency_limit launch_already_active launch_not_pending launch_budget_exhausted launch_draining launch_side_effects_disabled launch_dispatch_disabled no_eligible_runner launch_image_unavailable pull_request_no_git_branch pull_request_no_project project_credential_missing project_credential_expired project_credential_revoked project_credential_substitution project_parent_credential_not_current project_lineage_invalid project_binding_missing project_binding_mismatch project_not_found project_capability_not_granted project_capability_unknown project_capabilities_required project_history_is_not_authority project_task_not_found project_task_project_missing project_task_not_active project_native_origin_missing project_broader_scope_required project_system_scope_required project_lifetime_invalid project_lifetime_not_finite project_lifetime_exceeds_maximum project_delegation_exceeds_parent project_renewal_not_allowed project_delegation_widened project_audience_mismatch project_deployment_claim_missing project_authority_disabled project_issuer_not_current project_operation_not_durable project_dispatch_gate_refused
details
One of:

Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.

object
key
required

The entitlement feature key that was hit, e.g. apps.max_count.

string
limit
required

The plan’s limit for this key.

integer format: int64
upgrade_url
required

Where to send the user to upgrade.

string
used
required

Current usage (count or bytes, per the key).

integer format: int64
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
launch
One of:

Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.

object
active

Weighted workspace slots already held by starting/running agent runs.

integer | null format: int64
cap_usd

The budget cap that refused.

number | null format: double
effective_spend_usd

Effective spend of the refusing budget scope (spend + in-flight reservations).

number | null format: double
max

The workspace’s configured agent-concurrency cap.

integer | null format: int64
provider

The provider whose budget cap refused; absent for the workspace-wide cap.

string | null
required_labels

Runner labels a fail-policy placement required and no runner offered.

Array<string>

Example

{
"code": "not_found"
}

Authentication required

Media typeapplication/json

The canonical JSON body of every error response. Every AppError serializes as this exact shape; code is the generated stable machine-readable vocabulary.

object
cap
One of:

Present only on an MCP budget refusal (429) — the refusing layer + retry hint.

object
layer
required

The refusing layer.

string
limit
required

The layer’s budget.

integer format: int64
retry_after_seconds

Seconds until a retry can pass, or null when it never will for this session.

integer | null format: int64
used
required

Calls already counted in the layer.

integer format: int64
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired fresh_auth_required source_not_released bad_request unprocessable precondition_failed conflict artifact_staging_busy artifact_staging_store_unavailable intervention_attachment_limit method_not_allowed rate_limited too_many_requests quota_exceeded mcp_cap_exceeded form_schema_invalid autosave_not_offered submit_not_offered idempotency_key_reused response_cap_reached required_missing database_error docker_error vault_error internal_error artifact_frames_unavailable identity_native_custody_unconfigured launch_concurrency_limit launch_already_active launch_not_pending launch_budget_exhausted launch_draining launch_side_effects_disabled launch_dispatch_disabled no_eligible_runner launch_image_unavailable pull_request_no_git_branch pull_request_no_project project_credential_missing project_credential_expired project_credential_revoked project_credential_substitution project_parent_credential_not_current project_lineage_invalid project_binding_missing project_binding_mismatch project_not_found project_capability_not_granted project_capability_unknown project_capabilities_required project_history_is_not_authority project_task_not_found project_task_project_missing project_task_not_active project_native_origin_missing project_broader_scope_required project_system_scope_required project_lifetime_invalid project_lifetime_not_finite project_lifetime_exceeds_maximum project_delegation_exceeds_parent project_renewal_not_allowed project_delegation_widened project_audience_mismatch project_deployment_claim_missing project_authority_disabled project_issuer_not_current project_operation_not_durable project_dispatch_gate_refused
details
One of:

Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.

object
key
required

The entitlement feature key that was hit, e.g. apps.max_count.

string
limit
required

The plan’s limit for this key.

integer format: int64
upgrade_url
required

Where to send the user to upgrade.

string
used
required

Current usage (count or bytes, per the key).

integer format: int64
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
launch
One of:

Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.

object
active

Weighted workspace slots already held by starting/running agent runs.

integer | null format: int64
cap_usd

The budget cap that refused.

number | null format: double
effective_spend_usd

Effective spend of the refusing budget scope (spend + in-flight reservations).

number | null format: double
max

The workspace’s configured agent-concurrency cap.

integer | null format: int64
provider

The provider whose budget cap refused; absent for the workspace-wide cap.

string | null
required_labels

Runner labels a fail-policy placement required and no runner offered.

Array<string>

Example

{
"code": "not_found"
}

Permission denied

Media typeapplication/json

The canonical JSON body of every error response. Every AppError serializes as this exact shape; code is the generated stable machine-readable vocabulary.

object
cap
One of:

Present only on an MCP budget refusal (429) — the refusing layer + retry hint.

object
layer
required

The refusing layer.

string
limit
required

The layer’s budget.

integer format: int64
retry_after_seconds

Seconds until a retry can pass, or null when it never will for this session.

integer | null format: int64
used
required

Calls already counted in the layer.

integer format: int64
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired fresh_auth_required source_not_released bad_request unprocessable precondition_failed conflict artifact_staging_busy artifact_staging_store_unavailable intervention_attachment_limit method_not_allowed rate_limited too_many_requests quota_exceeded mcp_cap_exceeded form_schema_invalid autosave_not_offered submit_not_offered idempotency_key_reused response_cap_reached required_missing database_error docker_error vault_error internal_error artifact_frames_unavailable identity_native_custody_unconfigured launch_concurrency_limit launch_already_active launch_not_pending launch_budget_exhausted launch_draining launch_side_effects_disabled launch_dispatch_disabled no_eligible_runner launch_image_unavailable pull_request_no_git_branch pull_request_no_project project_credential_missing project_credential_expired project_credential_revoked project_credential_substitution project_parent_credential_not_current project_lineage_invalid project_binding_missing project_binding_mismatch project_not_found project_capability_not_granted project_capability_unknown project_capabilities_required project_history_is_not_authority project_task_not_found project_task_project_missing project_task_not_active project_native_origin_missing project_broader_scope_required project_system_scope_required project_lifetime_invalid project_lifetime_not_finite project_lifetime_exceeds_maximum project_delegation_exceeds_parent project_renewal_not_allowed project_delegation_widened project_audience_mismatch project_deployment_claim_missing project_authority_disabled project_issuer_not_current project_operation_not_durable project_dispatch_gate_refused
details
One of:

Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.

object
key
required

The entitlement feature key that was hit, e.g. apps.max_count.

string
limit
required

The plan’s limit for this key.

integer format: int64
upgrade_url
required

Where to send the user to upgrade.

string
used
required

Current usage (count or bytes, per the key).

integer format: int64
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
launch
One of:

Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.

object
active

Weighted workspace slots already held by starting/running agent runs.

integer | null format: int64
cap_usd

The budget cap that refused.

number | null format: double
effective_spend_usd

Effective spend of the refusing budget scope (spend + in-flight reservations).

number | null format: double
max

The workspace’s configured agent-concurrency cap.

integer | null format: int64
provider

The provider whose budget cap refused; absent for the workspace-wide cap.

string | null
required_labels

Runner labels a fail-policy placement required and no runner offered.

Array<string>

Example

{
"code": "not_found"
}

Structured server error

Media typeapplication/json

The canonical JSON body of every error response. Every AppError serializes as this exact shape; code is the generated stable machine-readable vocabulary.

object
cap
One of:

Present only on an MCP budget refusal (429) — the refusing layer + retry hint.

object
layer
required

The refusing layer.

string
limit
required

The layer’s budget.

integer format: int64
retry_after_seconds

Seconds until a retry can pass, or null when it never will for this session.

integer | null format: int64
used
required

Calls already counted in the layer.

integer format: int64
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired fresh_auth_required source_not_released bad_request unprocessable precondition_failed conflict artifact_staging_busy artifact_staging_store_unavailable intervention_attachment_limit method_not_allowed rate_limited too_many_requests quota_exceeded mcp_cap_exceeded form_schema_invalid autosave_not_offered submit_not_offered idempotency_key_reused response_cap_reached required_missing database_error docker_error vault_error internal_error artifact_frames_unavailable identity_native_custody_unconfigured launch_concurrency_limit launch_already_active launch_not_pending launch_budget_exhausted launch_draining launch_side_effects_disabled launch_dispatch_disabled no_eligible_runner launch_image_unavailable pull_request_no_git_branch pull_request_no_project project_credential_missing project_credential_expired project_credential_revoked project_credential_substitution project_parent_credential_not_current project_lineage_invalid project_binding_missing project_binding_mismatch project_not_found project_capability_not_granted project_capability_unknown project_capabilities_required project_history_is_not_authority project_task_not_found project_task_project_missing project_task_not_active project_native_origin_missing project_broader_scope_required project_system_scope_required project_lifetime_invalid project_lifetime_not_finite project_lifetime_exceeds_maximum project_delegation_exceeds_parent project_renewal_not_allowed project_delegation_widened project_audience_mismatch project_deployment_claim_missing project_authority_disabled project_issuer_not_current project_operation_not_durable project_dispatch_gate_refused
details
One of:

Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.

object
key
required

The entitlement feature key that was hit, e.g. apps.max_count.

string
limit
required

The plan’s limit for this key.

integer format: int64
upgrade_url
required

Where to send the user to upgrade.

string
used
required

Current usage (count or bytes, per the key).

integer format: int64
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
launch
One of:

Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.

object
active

Weighted workspace slots already held by starting/running agent runs.

integer | null format: int64
cap_usd

The budget cap that refused.

number | null format: double
effective_spend_usd

Effective spend of the refusing budget scope (spend + in-flight reservations).

number | null format: double
max

The workspace’s configured agent-concurrency cap.

integer | null format: int64
provider

The provider whose budget cap refused; absent for the workspace-wide cap.

string | null
required_labels

Runner labels a fail-policy placement required and no runner offered.

Array<string>

Example

{
"code": "not_found"
}