Generative Workflow Templates Endpoints¶
Generative Workflow Templates API endpoints.
Overview¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/generative-workflow-templates/ |
List Templates |
| POST | /api/v1/generative-workflow-templates/ |
Create Template |
| POST | /api/v1/generative-workflow-templates/import |
Import Workflow Template |
| GET | /api/v1/generative-workflow-templates/{template_id} |
Get Template |
| PATCH | /api/v1/generative-workflow-templates/{template_id} |
Update Template |
| DELETE | /api/v1/generative-workflow-templates/{template_id} |
Soft Delete Template |
| POST | /api/v1/generative-workflow-templates/{template_id}/render |
Render Template |
| POST | /api/v1/generative-workflow-templates/{template_id}/validate |
Validate Template |
API Reference¶
Sartiq Backend Server - Generative Workflow Templates 0.1.0¶
generative-workflow-templates¶
GET /api/v1/generative-workflow-templates/¶
List Templates
Description
Org-scoped list of templates, soft-deleted excluded.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
include_public |
query | boolean | False | No | |
limit |
query | integer | 50 | No | |
organization_id |
query | No | |||
purpose |
query | No | |||
q |
query | No | |||
skip |
query | integer | 0 | No | |
tags |
query | No | |||
validation_status |
query | No |
Responses
{
"data": [
{
"name": "string",
"description": null,
"notes": null,
"tags": [
"string"
],
"engine": "string",
"schema_version": "string",
"definition_json": {
"config": {},
"suppress_subtask_events": true,
"steps": [
{
"id": "string",
"task_type": "string",
"node_type": null,
"node_schema_version": 0,
"config": {},
"depends_on": [
"string"
],
"input_mappings": [
{
"from_step": "string",
"from_field": "string",
"to_field": "string",
"transform": null
}
],
"max_retries": 0,
"provider_config": null,
"active_provider_capabilities": null,
"fallback_provider_type": null,
"fallback_provider_config": null,
"fallback_provider_capabilities": null
}
],
"qa_expansion": null
},
"inputs_schema_json": {},
"purpose": null,
"is_public": true,
"id": "0464350c-391c-4842-8478-999dbbd1dbb9",
"owner_id": null,
"organization_id": null,
"system_role": null,
"revision": 0,
"validation_status": "valid",
"validation_errors": null,
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"deleted_at": null
}
],
"count": 0
}
Schema of the response body
POST /api/v1/generative-workflow-templates/¶
Create Template
Description
Create a new template.
The template is persisted regardless of validation outcome — a
structurally-parseable but semantically-broken payload lands with
validation_status="invalid" (locked decision #9).
MVP full_inputs contract (locked #29): templates may declare
any subset of these inputs in inputs_schema_json:
generation_id, prediction_id, production_request_id,
shot_id (UUID strings); width, height, seed (ints);
prompt (str); base_image_url (str); reference_images
(list[str]). URL fields are compute-server-reachable internal URLs
produced via app.services.storage.get_internal_url(...).
Runtime contract (locked #14): the final compute-DAG step must
emit result_image_path. Enforced by the event service at
workflow completion, NOT at create time.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
query | No |
Request body
{
"name": "string",
"description": null,
"notes": null,
"tags": [
"string"
],
"engine": "string",
"schema_version": "string",
"definition_json": {
"config": {},
"suppress_subtask_events": true,
"steps": [
{
"id": "string",
"task_type": "string",
"node_type": null,
"node_schema_version": 0,
"config": {},
"depends_on": [
"string"
],
"input_mappings": [
{
"from_step": "string",
"from_field": "string",
"to_field": "string",
"transform": null
}
],
"max_retries": 0,
"provider_config": null,
"active_provider_capabilities": null,
"fallback_provider_type": null,
"fallback_provider_config": null,
"fallback_provider_capabilities": null
}
],
"qa_expansion": null
},
"inputs_schema_json": {},
"purpose": null,
"is_public": true
}
Schema of the request body
{
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"minLength": 1,
"title": "Name"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Notes"
},
"tags": {
"items": {
"type": "string"
},
"type": "array",
"title": "Tags"
},
"engine": {
"type": "string",
"maxLength": 32,
"title": "Engine",
"default": "compute_dag"
},
"schema_version": {
"type": "string",
"maxLength": 64,
"title": "Schema Version",
"default": "generative-workflow/v1"
},
"definition_json": {
"$ref": "#/components/schemas/GenerativeWorkflowDefinition-Input"
},
"inputs_schema_json": {
"additionalProperties": {
"$ref": "#/components/schemas/GenerativeWorkflowInputDef"
},
"type": "object",
"title": "Inputs Schema Json"
},
"purpose": {
"anyOf": [
{
"$ref": "#/components/schemas/WorkflowPurpose"
},
{
"type": "null"
}
]
},
"is_public": {
"type": "boolean",
"title": "Is Public",
"default": false
}
},
"type": "object",
"required": [
"name",
"definition_json"
],
"title": "GenerativeWorkflowTemplateCreate",
"description": "POST payload.\n\nServer-managed fields (`id`, `revision`, `validation_status`,\n`validation_errors`, timestamps, `owner_id`, `organization_id`) are\nNOT accepted here; if present they are silently dropped (pydantic\ndefault).\n\nMVP `full_inputs` contract (locked plan decision #29): templates may\ndeclare any subset of these inputs in `inputs_schema_json`:\n`generation_id`, `prediction_id`, `production_request_id`, `shot_id`\n(UUID strings); `width`, `height`, `seed` (ints); `prompt` (str);\n`base_image_url` (str); `reference_images` (list[str]). URL fields\nare compute-server-reachable internal URLs (produced via\n`app.services.storage.get_internal_url(...)`).\n\nRuntime contract (locked plan decision #14): the final step must\nemit `result_image_path`. Enforced by the event service at workflow\ncompletion, NOT at create time."
}
Responses
{
"name": "string",
"description": null,
"notes": null,
"tags": [
"string"
],
"engine": "string",
"schema_version": "string",
"definition_json": {
"config": {},
"suppress_subtask_events": true,
"steps": [
{
"id": "string",
"task_type": "string",
"node_type": null,
"node_schema_version": 0,
"config": {},
"depends_on": [
"string"
],
"input_mappings": [
{
"from_step": "string",
"from_field": "string",
"to_field": "string",
"transform": null
}
],
"max_retries": 0,
"provider_config": null,
"active_provider_capabilities": null,
"fallback_provider_type": null,
"fallback_provider_config": null,
"fallback_provider_capabilities": null
}
],
"qa_expansion": null
},
"inputs_schema_json": {},
"purpose": null,
"is_public": true,
"id": "b78e256d-36b4-48df-ab71-14c3fa3e04ca",
"owner_id": null,
"organization_id": null,
"system_role": null,
"revision": 0,
"validation_status": "valid",
"validation_errors": null,
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"deleted_at": null
}
Schema of the response body
{
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"minLength": 1,
"title": "Name"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Notes"
},
"tags": {
"items": {
"type": "string"
},
"type": "array",
"title": "Tags"
},
"engine": {
"type": "string",
"maxLength": 32,
"title": "Engine",
"default": "compute_dag"
},
"schema_version": {
"type": "string",
"maxLength": 64,
"title": "Schema Version",
"default": "generative-workflow/v1"
},
"definition_json": {
"$ref": "#/components/schemas/GenerativeWorkflowDefinition-Output"
},
"inputs_schema_json": {
"additionalProperties": {
"$ref": "#/components/schemas/GenerativeWorkflowInputDef"
},
"type": "object",
"title": "Inputs Schema Json"
},
"purpose": {
"anyOf": [
{
"$ref": "#/components/schemas/WorkflowPurpose"
},
{
"type": "null"
}
]
},
"is_public": {
"type": "boolean",
"title": "Is Public",
"default": false
},
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"owner_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Owner Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"system_role": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "System Role"
},
"revision": {
"type": "integer",
"title": "Revision"
},
"validation_status": {
"$ref": "#/components/schemas/GenerativeWorkflowValidationStatus"
},
"validation_errors": {
"anyOf": [
{
"items": {
"$ref": "#/components/schemas/GenerativeWorkflowValidationError"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Validation Errors"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"type": "object",
"required": [
"name",
"definition_json",
"id",
"revision",
"validation_status",
"created_at",
"updated_at"
],
"title": "GenerativeWorkflowTemplatePublic",
"description": "GET response — server-side state included.\n\n``owner_id`` and ``organization_id`` are NULL for system templates\n(e.g., the seeded mannequin pipeline rows); user-owned templates\nalways populate both. ``system_role`` is non-NULL only for system\nrows and lets clients render edit affordances accordingly (UI hides\nthe \"edit\" button on system rows for non-superusers)."
}
GET /api/v1/generative-workflow-templates/{template_id}¶
Get Template
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
query | No | |||
template_id |
path | string | No |
Responses
{
"name": "string",
"description": null,
"notes": null,
"tags": [
"string"
],
"engine": "string",
"schema_version": "string",
"definition_json": {
"config": {},
"suppress_subtask_events": true,
"steps": [
{
"id": "string",
"task_type": "string",
"node_type": null,
"node_schema_version": 0,
"config": {},
"depends_on": [
"string"
],
"input_mappings": [
{
"from_step": "string",
"from_field": "string",
"to_field": "string",
"transform": null
}
],
"max_retries": 0,
"provider_config": null,
"active_provider_capabilities": null,
"fallback_provider_type": null,
"fallback_provider_config": null,
"fallback_provider_capabilities": null
}
],
"qa_expansion": null
},
"inputs_schema_json": {},
"purpose": null,
"is_public": true,
"id": "acc4c15e-97a6-4ceb-9dc0-6227c6d3e934",
"owner_id": null,
"organization_id": null,
"system_role": null,
"revision": 0,
"validation_status": "valid",
"validation_errors": null,
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"deleted_at": null
}
Schema of the response body
{
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"minLength": 1,
"title": "Name"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Notes"
},
"tags": {
"items": {
"type": "string"
},
"type": "array",
"title": "Tags"
},
"engine": {
"type": "string",
"maxLength": 32,
"title": "Engine",
"default": "compute_dag"
},
"schema_version": {
"type": "string",
"maxLength": 64,
"title": "Schema Version",
"default": "generative-workflow/v1"
},
"definition_json": {
"$ref": "#/components/schemas/GenerativeWorkflowDefinition-Output"
},
"inputs_schema_json": {
"additionalProperties": {
"$ref": "#/components/schemas/GenerativeWorkflowInputDef"
},
"type": "object",
"title": "Inputs Schema Json"
},
"purpose": {
"anyOf": [
{
"$ref": "#/components/schemas/WorkflowPurpose"
},
{
"type": "null"
}
]
},
"is_public": {
"type": "boolean",
"title": "Is Public",
"default": false
},
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"owner_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Owner Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"system_role": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "System Role"
},
"revision": {
"type": "integer",
"title": "Revision"
},
"validation_status": {
"$ref": "#/components/schemas/GenerativeWorkflowValidationStatus"
},
"validation_errors": {
"anyOf": [
{
"items": {
"$ref": "#/components/schemas/GenerativeWorkflowValidationError"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Validation Errors"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"type": "object",
"required": [
"name",
"definition_json",
"id",
"revision",
"validation_status",
"created_at",
"updated_at"
],
"title": "GenerativeWorkflowTemplatePublic",
"description": "GET response — server-side state included.\n\n``owner_id`` and ``organization_id`` are NULL for system templates\n(e.g., the seeded mannequin pipeline rows); user-owned templates\nalways populate both. ``system_role`` is non-NULL only for system\nrows and lets clients render edit affordances accordingly (UI hides\nthe \"edit\" button on system rows for non-superusers)."
}
PATCH /api/v1/generative-workflow-templates/{template_id}¶
Update Template
Description
Patch a template. Bumps revision. Re-validates.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
query | No | |||
template_id |
path | string | No |
Request body
{
"name": null,
"description": null,
"notes": null,
"tags": null,
"engine": null,
"schema_version": null,
"definition_json": null,
"inputs_schema_json": null,
"purpose": null,
"is_public": null
}
Schema of the request body
{
"properties": {
"name": {
"anyOf": [
{
"type": "string",
"maxLength": 255,
"minLength": 1
},
{
"type": "null"
}
],
"title": "Name"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Notes"
},
"tags": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Tags"
},
"engine": {
"anyOf": [
{
"type": "string",
"maxLength": 32
},
{
"type": "null"
}
],
"title": "Engine"
},
"schema_version": {
"anyOf": [
{
"type": "string",
"maxLength": 64
},
{
"type": "null"
}
],
"title": "Schema Version"
},
"definition_json": {
"anyOf": [
{
"$ref": "#/components/schemas/GenerativeWorkflowDefinition-Input"
},
{
"type": "null"
}
]
},
"inputs_schema_json": {
"anyOf": [
{
"additionalProperties": {
"$ref": "#/components/schemas/GenerativeWorkflowInputDef"
},
"type": "object"
},
{
"type": "null"
}
],
"title": "Inputs Schema Json"
},
"purpose": {
"anyOf": [
{
"$ref": "#/components/schemas/WorkflowPurpose"
},
{
"type": "null"
}
]
},
"is_public": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Is Public"
}
},
"type": "object",
"title": "GenerativeWorkflowTemplateUpdate",
"description": "PATCH payload — all fields optional.\n\nSaving an update bumps `revision` and re-runs validation."
}
Responses
{
"name": "string",
"description": null,
"notes": null,
"tags": [
"string"
],
"engine": "string",
"schema_version": "string",
"definition_json": {
"config": {},
"suppress_subtask_events": true,
"steps": [
{
"id": "string",
"task_type": "string",
"node_type": null,
"node_schema_version": 0,
"config": {},
"depends_on": [
"string"
],
"input_mappings": [
{
"from_step": "string",
"from_field": "string",
"to_field": "string",
"transform": null
}
],
"max_retries": 0,
"provider_config": null,
"active_provider_capabilities": null,
"fallback_provider_type": null,
"fallback_provider_config": null,
"fallback_provider_capabilities": null
}
],
"qa_expansion": null
},
"inputs_schema_json": {},
"purpose": null,
"is_public": true,
"id": "fe26296f-44bc-4825-888e-9949a43a8be7",
"owner_id": null,
"organization_id": null,
"system_role": null,
"revision": 0,
"validation_status": "valid",
"validation_errors": null,
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"deleted_at": null
}
Schema of the response body
{
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"minLength": 1,
"title": "Name"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Notes"
},
"tags": {
"items": {
"type": "string"
},
"type": "array",
"title": "Tags"
},
"engine": {
"type": "string",
"maxLength": 32,
"title": "Engine",
"default": "compute_dag"
},
"schema_version": {
"type": "string",
"maxLength": 64,
"title": "Schema Version",
"default": "generative-workflow/v1"
},
"definition_json": {
"$ref": "#/components/schemas/GenerativeWorkflowDefinition-Output"
},
"inputs_schema_json": {
"additionalProperties": {
"$ref": "#/components/schemas/GenerativeWorkflowInputDef"
},
"type": "object",
"title": "Inputs Schema Json"
},
"purpose": {
"anyOf": [
{
"$ref": "#/components/schemas/WorkflowPurpose"
},
{
"type": "null"
}
]
},
"is_public": {
"type": "boolean",
"title": "Is Public",
"default": false
},
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"owner_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Owner Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"system_role": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "System Role"
},
"revision": {
"type": "integer",
"title": "Revision"
},
"validation_status": {
"$ref": "#/components/schemas/GenerativeWorkflowValidationStatus"
},
"validation_errors": {
"anyOf": [
{
"items": {
"$ref": "#/components/schemas/GenerativeWorkflowValidationError"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Validation Errors"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"type": "object",
"required": [
"name",
"definition_json",
"id",
"revision",
"validation_status",
"created_at",
"updated_at"
],
"title": "GenerativeWorkflowTemplatePublic",
"description": "GET response — server-side state included.\n\n``owner_id`` and ``organization_id`` are NULL for system templates\n(e.g., the seeded mannequin pipeline rows); user-owned templates\nalways populate both. ``system_role`` is non-NULL only for system\nrows and lets clients render edit affordances accordingly (UI hides\nthe \"edit\" button on system rows for non-superusers)."
}
DELETE /api/v1/generative-workflow-templates/{template_id}¶
Soft Delete Template
Description
Soft-delete a template.
Returns 409 with the locked
GenerativeWorkflowDeletionConflict body when the template is
referenced by non-deleted shootingguidelines or
productionrequest rows. Hard delete is not exposed in MVP
(locked decision #8).
SAR-1623 follow-up — system templates can only be deleted by a superuser (the route returns 403 for org members).
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
query | No | |||
template_id |
path | string | No |
Responses
POST /api/v1/generative-workflow-templates/import¶
Import Workflow Template
Description
Import a workflow as an org-owned template.
Accepts both a full workflow-editor export and a plain workflow already
stripped of editor blocks. The document is mapped to a
GenerativeWorkflowTemplateCreate (editor_* blocks stripped,
name/description reparented, steps wrapped into
definition_json, engine pinned to compute_dag, provenance
tags stamped) and then handed to the same create path — so it
inherits persist-then-validate: a structurally-parseable but
semantically-broken workflow lands with validation_status="invalid"
rather than a 422. A document that will not even parse (missing
steps, malformed step) is a 422 at the request-schema boundary.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
query | No |
Request body
{
"document": {
"name": "string",
"description": null,
"origin_instance": null,
"config": {},
"suppress_subtask_events": true,
"steps": [
{
"id": "string",
"task_type": "string",
"node_type": null,
"node_schema_version": 0,
"config": {},
"depends_on": [
"string"
],
"input_mappings": [
{
"from_step": "string",
"from_field": "string",
"to_field": "string",
"transform": null
}
],
"max_retries": 0,
"provider_config": null,
"active_provider_capabilities": null,
"fallback_provider_type": null,
"fallback_provider_config": null,
"fallback_provider_capabilities": null
}
]
},
"purpose": null,
"is_public": true,
"tags": [
"string"
],
"notes": null
}
Schema of the request body
{
"properties": {
"document": {
"$ref": "#/components/schemas/WorkflowImportDocument"
},
"purpose": {
"anyOf": [
{
"$ref": "#/components/schemas/WorkflowPurpose"
},
{
"type": "null"
}
]
},
"is_public": {
"type": "boolean",
"title": "Is Public",
"default": false
},
"tags": {
"items": {
"type": "string"
},
"type": "array",
"title": "Tags"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Notes"
}
},
"type": "object",
"required": [
"document"
],
"title": "WorkflowImportRequest",
"description": "POST body for importing a workflow as an org-owned template.\n\n``document`` is the workflow to import (a workflow-editor export or a\nplain stripped workflow); the remaining fields are backend-side import\noptions the document has no notion of:\n\n- ``purpose`` — the eligibility slot the imported template plugs into\n (e.g. ``post_production``). Strict-enum (unknown → 422), same as the\n create envelope.\n- ``is_public`` — superuser-gated in the route, mirroring create.\n- ``tags`` / ``notes`` — author-supplied metadata. The importer always\n adds a ``workflow-import`` provenance tag (plus\n ``workflow-origin:<instance>`` when the doc carries one) so imported\n rows stay discoverable/filterable.\n\n``engine`` is intentionally NOT accepted: imported workflows are\ncompute DAGs, and the ``purpose='post_production'`` validator requires\n``compute_dag`` regardless, so the mapper pins it."
}
Responses
{
"name": "string",
"description": null,
"notes": null,
"tags": [
"string"
],
"engine": "string",
"schema_version": "string",
"definition_json": {
"config": {},
"suppress_subtask_events": true,
"steps": [
{
"id": "string",
"task_type": "string",
"node_type": null,
"node_schema_version": 0,
"config": {},
"depends_on": [
"string"
],
"input_mappings": [
{
"from_step": "string",
"from_field": "string",
"to_field": "string",
"transform": null
}
],
"max_retries": 0,
"provider_config": null,
"active_provider_capabilities": null,
"fallback_provider_type": null,
"fallback_provider_config": null,
"fallback_provider_capabilities": null
}
],
"qa_expansion": null
},
"inputs_schema_json": {},
"purpose": null,
"is_public": true,
"id": "a75290a6-6b79-41ed-9beb-401b8a89383c",
"owner_id": null,
"organization_id": null,
"system_role": null,
"revision": 0,
"validation_status": "valid",
"validation_errors": null,
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"deleted_at": null
}
Schema of the response body
{
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"minLength": 1,
"title": "Name"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Notes"
},
"tags": {
"items": {
"type": "string"
},
"type": "array",
"title": "Tags"
},
"engine": {
"type": "string",
"maxLength": 32,
"title": "Engine",
"default": "compute_dag"
},
"schema_version": {
"type": "string",
"maxLength": 64,
"title": "Schema Version",
"default": "generative-workflow/v1"
},
"definition_json": {
"$ref": "#/components/schemas/GenerativeWorkflowDefinition-Output"
},
"inputs_schema_json": {
"additionalProperties": {
"$ref": "#/components/schemas/GenerativeWorkflowInputDef"
},
"type": "object",
"title": "Inputs Schema Json"
},
"purpose": {
"anyOf": [
{
"$ref": "#/components/schemas/WorkflowPurpose"
},
{
"type": "null"
}
]
},
"is_public": {
"type": "boolean",
"title": "Is Public",
"default": false
},
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"owner_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Owner Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"system_role": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "System Role"
},
"revision": {
"type": "integer",
"title": "Revision"
},
"validation_status": {
"$ref": "#/components/schemas/GenerativeWorkflowValidationStatus"
},
"validation_errors": {
"anyOf": [
{
"items": {
"$ref": "#/components/schemas/GenerativeWorkflowValidationError"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Validation Errors"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"type": "object",
"required": [
"name",
"definition_json",
"id",
"revision",
"validation_status",
"created_at",
"updated_at"
],
"title": "GenerativeWorkflowTemplatePublic",
"description": "GET response — server-side state included.\n\n``owner_id`` and ``organization_id`` are NULL for system templates\n(e.g., the seeded mannequin pipeline rows); user-owned templates\nalways populate both. ``system_role`` is non-NULL only for system\nrows and lets clients render edit affordances accordingly (UI hides\nthe \"edit\" button on system rows for non-superusers)."
}
POST /api/v1/generative-workflow-templates/{template_id}/validate¶
Validate Template
Description
Idempotent re-validation. Returns {status, errors} only.
SAR-1623 follow-up — re-validation persists validation_status
and validation_errors on the row, so a non-superuser cannot
flip a system template's gate state. The 403 fires before the
write lands.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
query | No | |||
template_id |
path | string | No |
Responses
Schema of the response body
{
"properties": {
"status": {
"$ref": "#/components/schemas/GenerativeWorkflowValidationStatus"
},
"errors": {
"items": {
"$ref": "#/components/schemas/GenerativeWorkflowValidationError"
},
"type": "array",
"title": "Errors"
}
},
"type": "object",
"required": [
"status"
],
"title": "GenerativeWorkflowValidationResponse",
"description": "Locked response for `POST /{id}/validate` (plan decision #14)."
}
POST /api/v1/generative-workflow-templates/{template_id}/render¶
Render Template
Description
Single-pass dry-run render — same code path as the engine adapter uses at dispatch time (locked decision #5).
404 cross-org per locked decision #17, except SAR-1818 public
templates, which are renderable cross-org. Substitution errors are
surfaced as 400 with the locked {path, code, message} body
verbatim (not wrapped in detail — that's why we return a
JSONResponse directly here).
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
query | No | |||
template_id |
path | string | No |
Request body
Responses
Schemas¶
GenerativeWorkflowDefinition-Input¶
| Name | Type | Description |
|---|---|---|
config |
||
qa_expansion |
||
steps |
Array<GenerativeWorkflowStepDefinition> | |
suppress_subtask_events |
boolean |
GenerativeWorkflowDefinition-Output¶
| Name | Type | Description |
|---|---|---|
config |
||
qa_expansion |
||
steps |
Array<GenerativeWorkflowStepDefinition> | |
suppress_subtask_events |
boolean |
GenerativeWorkflowFieldMapping¶
| Name | Type | Description |
|---|---|---|
from_field |
string | |
from_step |
string | |
to_field |
string | |
transform |
GenerativeWorkflowInputDef¶
| Name | Type | Description |
|---|---|---|
default |
||
description |
||
nullable |
boolean | |
required |
boolean | |
source |
||
type |
string | One of: string, integer, number, boolean, array, object |
GenerativeWorkflowRenderRequest¶
| Name | Type | Description |
|---|---|---|
inputs |
GenerativeWorkflowRenderResponse¶
| Name | Type | Description |
|---|---|---|
rendered |
GenerativeWorkflowStepDefinition¶
| Name | Type | Description |
|---|---|---|
active_provider_capabilities |
||
config |
||
depends_on |
Array<string> | |
fallback_provider_capabilities |
||
fallback_provider_config |
||
fallback_provider_type |
||
id |
string | |
input_mappings |
Array<GenerativeWorkflowFieldMapping> | |
max_retries |
integer | |
node_schema_version |
integer | |
node_type |
||
provider_config |
||
task_type |
string |
GenerativeWorkflowTemplateCreate¶
| Name | Type | Description |
|---|---|---|
definition_json |
GenerativeWorkflowDefinition-Input | |
description |
||
engine |
string | |
inputs_schema_json |
||
is_public |
boolean | |
name |
string | |
notes |
||
purpose |
||
schema_version |
string | |
tags |
Array<string> |
GenerativeWorkflowTemplatePublic¶
| Name | Type | Description |
|---|---|---|
created_at |
string(date-time) | |
definition_json |
GenerativeWorkflowDefinition-Output | |
deleted_at |
||
description |
||
engine |
string | |
id |
string(uuid) | |
inputs_schema_json |
||
is_public |
boolean | |
name |
string | |
notes |
||
organization_id |
||
owner_id |
||
purpose |
||
revision |
integer | |
schema_version |
string | |
system_role |
||
tags |
Array<string> | |
updated_at |
string(date-time) | |
validation_errors |
||
validation_status |
GenerativeWorkflowValidationStatus |
GenerativeWorkflowTemplatesPublic¶
| Name | Type | Description |
|---|---|---|
count |
integer | |
data |
Array<GenerativeWorkflowTemplatePublic> |
GenerativeWorkflowTemplateUpdate¶
| Name | Type | Description |
|---|---|---|
definition_json |
||
description |
||
engine |
||
inputs_schema_json |
||
is_public |
||
name |
||
notes |
||
purpose |
||
schema_version |
||
tags |
GenerativeWorkflowValidationError¶
| Name | Type | Description |
|---|---|---|
code |
string | |
message |
string | |
path |
string |
GenerativeWorkflowValidationResponse¶
| Name | Type | Description |
|---|---|---|
errors |
Array<GenerativeWorkflowValidationError> | |
status |
GenerativeWorkflowValidationStatus |
GenerativeWorkflowValidationStatus¶
Type: string
HTTPValidationError¶
| Name | Type | Description |
|---|---|---|
detail |
Array<ValidationError> |
QualityAssessmentExpansion¶
| Name | Type | Description |
|---|---|---|
aggregate_step_id |
string | |
identity_report_step_id |
||
product_report_step_id |
string |
ValidationError¶
| Name | Type | Description |
|---|---|---|
ctx |
||
input |
||
loc |
Array<> | |
msg |
string | |
type |
string |
WorkflowImportDocument¶
| Name | Type | Description |
|---|---|---|
config |
||
description |
||
name |
string | |
origin_instance |
||
steps |
Array<GenerativeWorkflowStepDefinition> | |
suppress_subtask_events |
boolean |
WorkflowImportRequest¶
| Name | Type | Description |
|---|---|---|
document |
WorkflowImportDocument | |
is_public |
boolean | |
notes |
||
purpose |
||
tags |
Array<string> |
WorkflowPurpose¶
Type: string
Security schemes¶
| Name | Type | Scheme | Description |
|---|---|---|---|
| OAuth2PasswordBearer | oauth2 |