{"openapi":"3.1.0","info":{"title":"workflow.parklab.work","description":"Declarative, versioned, agent-native workflow engine.","version":"0.1.0"},"paths":{"/healthz":{"get":{"tags":["health"],"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Healthz Healthz Get"}}}}}}},"/readyz":{"get":{"tags":["health"],"summary":"Readyz","operationId":"readyz_readyz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Readyz Readyz Get"}}}}}}},"/v1/version":{"get":{"tags":["health"],"summary":"Version","operationId":"version_v1_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Version V1 Version Get"}}}}}}},"/stats":{"get":{"tags":["observability"],"summary":"Stats","operationId":"stats_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Stats Stats Get"}}}}}}},"/workflows/validate":{"post":{"tags":["workflows"],"summary":"Validate","description":"Validate a WDL document without persisting (agents call this before publish).","operationId":"validate_workflows_validate_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows":{"post":{"tags":["workflows"],"summary":"Create Workflow","operationId":"create_workflow_workflows_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["workflows"],"summary":"List Workflows","operationId":"list_workflows_workflows_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowOut"},"title":"Response List Workflows Workflows Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{slug}":{"get":{"tags":["workflows"],"summary":"Get Workflow","operationId":"get_workflow_workflows__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["workflows"],"summary":"Patch Workflow","operationId":"patch_workflow_workflows__slug__patch","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{slug}/versions":{"post":{"tags":["workflows"],"summary":"Publish Version","operationId":"publish_version_workflows__slug__versions_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["workflows"],"summary":"List Versions","operationId":"list_versions_workflows__slug__versions_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VersionSummary"},"title":"Response List Versions Workflows  Slug  Versions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{slug}/versions/{version}":{"get":{"tags":["workflows"],"summary":"Get Version","operationId":"get_version_workflows__slug__versions__version__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","title":"Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{slug}/versions/{version}/deprecate":{"post":{"tags":["workflows"],"summary":"Deprecate Version","operationId":"deprecate_version_workflows__slug__versions__version__deprecate_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","title":"Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{slug}/versions/{version}/mermaid":{"get":{"tags":["workflows","observability"],"summary":"Version Mermaid","description":"Render a version's WDL as a Mermaid stateDiagram-v2 (read-only convenience).","operationId":"version_mermaid_workflows__slug__versions__version__mermaid_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","title":"Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{slug}/instances":{"post":{"tags":["instances"],"summary":"Start Instance","operationId":"start_instance_workflows__slug__instances_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartInstanceRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["instances"],"summary":"List Instances","operationId":"list_instances_workflows__slug__instances_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InstanceOut"},"title":"Response List Instances Workflows  Slug  Instances Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/instances/{instance_id}":{"get":{"tags":["instances"],"summary":"Get Instance","operationId":"get_instance_instances__instance_id__get","parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Instance Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/instances/{instance_id}/history":{"get":{"tags":["instances"],"summary":"Get History","operationId":"get_history_instances__instance_id__history_get","parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Instance Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HistoryEntryOut"},"title":"Response Get History Instances  Instance Id  History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/instances/{instance_id}/events":{"post":{"tags":["instances"],"summary":"Post Event","operationId":"post_event_instances__instance_id__events_post","parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Instance Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/instances/{instance_id}/cancel":{"post":{"tags":["instances"],"summary":"Cancel Instance","operationId":"cancel_instance_instances__instance_id__cancel_post","parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Instance Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"EventRequest":{"properties":{"type":{"type":"string","minLength":1,"title":"Type"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"}},"type":"object","required":["type"],"title":"EventRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HistoryEntryOut":{"properties":{"seq":{"type":"integer","title":"Seq"},"kind":{"type":"string","title":"Kind"},"event_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"},"from_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From State"},"to_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To State"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"}},"type":"object","required":["seq","kind","event_type","payload","from_state","to_state","occurred_at"],"title":"HistoryEntryOut"},"InstanceOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workflow_id":{"type":"string","format":"uuid","title":"Workflow Id"},"workflow_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Slug"},"version":{"type":"integer","title":"Version"},"current_state":{"type":"string","title":"Current State"},"context":{"additionalProperties":true,"type":"object","title":"Context"},"status":{"type":"string","title":"Status"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","workflow_id","version","current_state","context","status","result","error","started_at","updated_at","completed_at"],"title":"InstanceOut"},"IssueOut":{"properties":{"severity":{"type":"string","title":"Severity"},"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"path":{"type":"string","title":"Path"}},"type":"object","required":["severity","code","message","path"],"title":"IssueOut"},"StartInstanceRequest":{"properties":{"input":{"additionalProperties":true,"type":"object","title":"Input"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"}},"type":"object","title":"StartInstanceRequest"},"ValidateRequest":{"properties":{"definition":{"additionalProperties":true,"type":"object","title":"Definition"}},"type":"object","required":["definition"],"title":"ValidateRequest"},"ValidateResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"errors":{"items":{"$ref":"#/components/schemas/IssueOut"},"type":"array","title":"Errors"},"warnings":{"items":{"$ref":"#/components/schemas/IssueOut"},"type":"array","title":"Warnings"}},"type":"object","required":["valid","errors","warnings"],"title":"ValidateResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VersionCreate":{"properties":{"definition":{"additionalProperties":true,"type":"object","title":"Definition"},"changelog":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Changelog"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"status":{"type":"string","title":"Status","default":"published"}},"type":"object","required":["definition"],"title":"VersionCreate"},"VersionOut":{"properties":{"version":{"type":"integer","title":"Version"},"status":{"type":"string","title":"Status"},"definition":{"additionalProperties":true,"type":"object","title":"Definition"},"definition_hash":{"type":"string","title":"Definition Hash"},"changelog":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Changelog"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["version","status","definition","definition_hash","changelog","created_by","created_at"],"title":"VersionOut"},"VersionSummary":{"properties":{"version":{"type":"integer","title":"Version"},"status":{"type":"string","title":"Status"},"definition_hash":{"type":"string","title":"Definition Hash"},"changelog":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Changelog"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["version","status","definition_hash","changelog","created_by","created_at"],"title":"VersionSummary"},"WorkflowCreate":{"properties":{"slug":{"type":"string","maxLength":200,"pattern":"^[a-z0-9][a-z0-9-]*$","title":"Slug"},"name":{"type":"string","maxLength":300,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"definition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Definition"},"changelog":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Changelog"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"}},"type":"object","required":["slug","name"],"title":"WorkflowCreate"},"WorkflowOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"default_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"versions":{"anyOf":[{"items":{"$ref":"#/components/schemas/VersionSummary"},"type":"array"},{"type":"null"}],"title":"Versions"}},"type":"object","required":["id","slug","name","description","default_version","created_at","updated_at"],"title":"WorkflowOut"},"WorkflowPatch":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":300,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"default_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Version"}},"type":"object","title":"WorkflowPatch"}}}}