{"openapi":"3.1.1","info":{"version":"1.0.0","title":"Arrow AIM Flow API","description":"API documentation for the Flow backend"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{},"parameters":{}},"paths":{"/api/v1/actions":{"get":{"summary":"List Actions","tags":["Action"],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"default":50,"description":"Maximum number of actions to return (max 200; default 50)"},"required":false,"description":"Maximum number of actions to return (max 200; default 50)","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of actions to skip"},"required":false,"description":"Number of actions to skip","name":"offset","in":"query"},{"schema":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}]},"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published"},"required":false,"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published","name":"filter","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc"},"required":false,"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc","name":"sort","in":"query"}],"responses":{"200":{"description":"List of Actions","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"actioncategoryId":{"type":["string","null"]},"implementationType":{"type":["string","null"],"enum":["Function","Inngest-step","Inngest-step-wrapped",null]},"inputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"outputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"validationRules":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"retryable":{"type":["boolean","null"]},"timeout":{"type":["string","null"]},"version":{"type":["string","null"]},"state":{"type":"string","enum":["draft","published"]},"latestPublishedVersionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","description","actioncategoryId","implementationType","inputSchema","outputSchema","validationRules","retryable","timeout","version","state","latestPublishedVersionId","createdAt","updatedAt","deletedAt"]}}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Requested team is not permitted for this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Create new Action","tags":["Action"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"description":{"type":["string","null"]},"actioncategoryId":{"type":"string"},"implementationType":{"type":"string","enum":["Function","Inngest-step","Inngest-step-wrapped"]},"inputSchema":{},"outputSchema":{},"validationRules":{},"retryable":{"type":"boolean"},"timeout":{"type":"string"},"version":{"type":"string"},"state":{"type":"string","enum":["draft","published"]},"latestPublishedVersionId":{"type":["string","null"]}},"required":["name","title"]}}}},"responses":{"201":{"description":"Action created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"actioncategoryId":{"type":["string","null"]},"implementationType":{"type":["string","null"],"enum":["Function","Inngest-step","Inngest-step-wrapped",null]},"inputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"outputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"validationRules":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"retryable":{"type":["boolean","null"]},"timeout":{"type":["string","null"]},"version":{"type":["string","null"]},"state":{"type":"string","enum":["draft","published"]},"latestPublishedVersionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","description","actioncategoryId","implementationType","inputSchema","outputSchema","validationRules","retryable","timeout","version","state","latestPublishedVersionId","createdAt","updatedAt","deletedAt"]}}}}}}},"/api/v1/actions/{id}":{"get":{"summary":"Get Action by ID","tags":["Action"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Action details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"actioncategoryId":{"type":["string","null"]},"implementationType":{"type":["string","null"],"enum":["Function","Inngest-step","Inngest-step-wrapped",null]},"inputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"outputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"validationRules":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"retryable":{"type":["boolean","null"]},"timeout":{"type":["string","null"]},"version":{"type":["string","null"]},"state":{"type":"string","enum":["draft","published"]},"latestPublishedVersionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","description","actioncategoryId","implementationType","inputSchema","outputSchema","validationRules","retryable","timeout","version","state","latestPublishedVersionId","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"Action not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"summary":"Update Action by ID","tags":["Action"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"description":{"type":["string","null"]},"actioncategoryId":{"type":"string"},"implementationType":{"type":"string","enum":["Function","Inngest-step","Inngest-step-wrapped"]},"inputSchema":{},"outputSchema":{},"validationRules":{},"retryable":{"type":"boolean"},"timeout":{"type":"string"},"version":{"type":"string"},"state":{"type":"string","enum":["draft","published"]},"latestPublishedVersionId":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"Action updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"actioncategoryId":{"type":["string","null"]},"implementationType":{"type":["string","null"],"enum":["Function","Inngest-step","Inngest-step-wrapped",null]},"inputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"outputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"validationRules":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"retryable":{"type":["boolean","null"]},"timeout":{"type":["string","null"]},"version":{"type":["string","null"]},"state":{"type":"string","enum":["draft","published"]},"latestPublishedVersionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","description","actioncategoryId","implementationType","inputSchema","outputSchema","validationRules","retryable","timeout","version","state","latestPublishedVersionId","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"Action not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Delete Action by ID","tags":["Action"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Action deleted"},"404":{"description":"Action not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/actions/{id}/versions":{"get":{"summary":"ListVersions Action","tags":["Action"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"List every version of the action (newest first) with per-version pinned-node counts","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"actionId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["published","deprecated"]},"inputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"outputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"validationRules":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"implementationType":{"type":["string","null"],"enum":["Function","Inngest-step","Inngest-step-wrapped",null]},"retryable":{"type":["boolean","null"]},"timeout":{"type":["string","null"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"pinnedNodeCount":{"type":"number"}},"required":["id","actionId","versionNumber","state","inputSchema","outputSchema","validationRules","implementationType","retryable","timeout","sourceFileChecksum","sourceSyncRunId","createdAt","updatedAt","deletedAt","pinnedNodeCount"]}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Action not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/actions/{id}/publish":{"post":{"summary":"Publish Action","tags":["Action"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Publish action from draft state","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"actioncategoryId":{"type":["string","null"]},"implementationType":{"type":["string","null"],"enum":["Function","Inngest-step","Inngest-step-wrapped",null]},"inputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"outputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"validationRules":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"retryable":{"type":["boolean","null"]},"timeout":{"type":["string","null"]},"version":{"type":["string","null"]},"state":{"type":"string","enum":["draft","published"]},"latestPublishedVersionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","description","actioncategoryId","implementationType","inputSchema","outputSchema","validationRules","retryable","timeout","version","state","latestPublishedVersionId","createdAt","updatedAt","deletedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Action not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/actions/{id}/unpublish":{"post":{"summary":"Unpublish Action","tags":["Action"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Unpublish action back to draft state","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"actioncategoryId":{"type":["string","null"]},"implementationType":{"type":["string","null"],"enum":["Function","Inngest-step","Inngest-step-wrapped",null]},"inputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"outputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"validationRules":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"retryable":{"type":["boolean","null"]},"timeout":{"type":["string","null"]},"version":{"type":["string","null"]},"state":{"type":"string","enum":["draft","published"]},"latestPublishedVersionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","description","actioncategoryId","implementationType","inputSchema","outputSchema","validationRules","retryable","timeout","version","state","latestPublishedVersionId","createdAt","updatedAt","deletedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Action not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/actionCategories":{"get":{"summary":"List Action Categories","tags":["Action Category"],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"default":50,"description":"Maximum number of action categories to return (max 200; default 50)"},"required":false,"description":"Maximum number of action categories to return (max 200; default 50)","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of action categories to skip"},"required":false,"description":"Number of action categories to skip","name":"offset","in":"query"},{"schema":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}]},"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published"},"required":false,"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published","name":"filter","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc"},"required":false,"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc","name":"sort","in":"query"}],"responses":{"200":{"description":"List of Action Categories","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"icon":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","icon","createdAt","updatedAt","deletedAt"]}}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Requested team is not permitted for this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Create new Action Category","tags":["Action Category"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"icon":{"type":"string","minLength":1}},"required":["name","title","icon"]}}}},"responses":{"201":{"description":"Action Category created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"icon":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","icon","createdAt","updatedAt","deletedAt"]}}}}}}},"/api/v1/actionCategories/{id}":{"get":{"summary":"Get Action Category by ID","tags":["Action Category"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Action Category details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"icon":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","icon","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"Action Category not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"summary":"Update Action Category by ID","tags":["Action Category"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"icon":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":"Action Category updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"icon":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","icon","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"Action Category not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Delete Action Category by ID","tags":["Action Category"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Action Category deleted"},"404":{"description":"Action Category not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/actionVersions":{"get":{"summary":"List Action Versions","tags":["ActionVersion"],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"default":50,"description":"Maximum number of action versions to return (max 200; default 50)"},"required":false,"description":"Maximum number of action versions to return (max 200; default 50)","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of action versions to skip"},"required":false,"description":"Number of action versions to skip","name":"offset","in":"query"},{"schema":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}]},"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published"},"required":false,"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published","name":"filter","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc"},"required":false,"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc","name":"sort","in":"query"}],"responses":{"200":{"description":"List of Action Versions","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"actionId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["published","deprecated"]},"inputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"outputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"validationRules":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"implementationType":{"type":["string","null"],"enum":["Function","Inngest-step","Inngest-step-wrapped",null]},"retryable":{"type":["boolean","null"]},"timeout":{"type":["string","null"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","actionId","versionNumber","state","inputSchema","outputSchema","validationRules","implementationType","retryable","timeout","sourceFileChecksum","sourceSyncRunId","createdAt","updatedAt","deletedAt"]}}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Requested team is not permitted for this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Create new ActionVersion","tags":["ActionVersion"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"actionId":{"type":"string","minLength":1},"versionNumber":{"type":"integer","exclusiveMinimum":0},"state":{"type":"string","enum":["published","deprecated"]},"inputSchema":{},"outputSchema":{},"validationRules":{},"implementationType":{"type":"string","enum":["Function","Inngest-step","Inngest-step-wrapped"]},"retryable":{"type":"boolean"},"timeout":{"type":["string","null"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]}},"required":["actionId","versionNumber"]}}}},"responses":{"201":{"description":"ActionVersion created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"actionId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["published","deprecated"]},"inputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"outputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"validationRules":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"implementationType":{"type":["string","null"],"enum":["Function","Inngest-step","Inngest-step-wrapped",null]},"retryable":{"type":["boolean","null"]},"timeout":{"type":["string","null"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","actionId","versionNumber","state","inputSchema","outputSchema","validationRules","implementationType","retryable","timeout","sourceFileChecksum","sourceSyncRunId","createdAt","updatedAt","deletedAt"]}}}}}}},"/api/v1/actionVersions/{id}":{"get":{"summary":"Get ActionVersion by ID","tags":["ActionVersion"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"ActionVersion details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"actionId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["published","deprecated"]},"inputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"outputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"validationRules":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"implementationType":{"type":["string","null"],"enum":["Function","Inngest-step","Inngest-step-wrapped",null]},"retryable":{"type":["boolean","null"]},"timeout":{"type":["string","null"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","actionId","versionNumber","state","inputSchema","outputSchema","validationRules","implementationType","retryable","timeout","sourceFileChecksum","sourceSyncRunId","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"ActionVersion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"summary":"Update ActionVersion by ID","tags":["ActionVersion"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"actionId":{"type":"string","minLength":1},"versionNumber":{"type":"integer","exclusiveMinimum":0},"state":{"type":"string","enum":["published","deprecated"]},"inputSchema":{},"outputSchema":{},"validationRules":{},"implementationType":{"type":"string","enum":["Function","Inngest-step","Inngest-step-wrapped"]},"retryable":{"type":"boolean"},"timeout":{"type":["string","null"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"ActionVersion updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"actionId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["published","deprecated"]},"inputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"outputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"validationRules":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"implementationType":{"type":["string","null"],"enum":["Function","Inngest-step","Inngest-step-wrapped",null]},"retryable":{"type":["boolean","null"]},"timeout":{"type":["string","null"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","actionId","versionNumber","state","inputSchema","outputSchema","validationRules","implementationType","retryable","timeout","sourceFileChecksum","sourceSyncRunId","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"ActionVersion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Delete ActionVersion by ID","tags":["ActionVersion"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"ActionVersion deleted"},"404":{"description":"ActionVersion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/actionVersions/{id}/pinned-nodes":{"get":{"summary":"ListPinnedNodes ActionVersion","tags":["ActionVersion"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"List the workflow nodes pinned to this action version, joined with their owning workflow and version","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"workflowNodeId":{"type":"string"},"nodeKey":{"type":["string","null"]},"nodeTitle":{"type":"string"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"workflowVersionNumber":{"type":"number"},"workflowVersionState":{"type":"string"}},"required":["workflowNodeId","nodeKey","nodeTitle","workflowId","workflowName","workflowVersionNumber","workflowVersionState"]}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"ActionVersion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/actionVersions/{id}/deprecate":{"post":{"summary":"Deprecate ActionVersion","tags":["ActionVersion"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deprecate an action version and recompute the action latest-published pointer (internal service-key only)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"actionId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["published","deprecated"]},"inputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"outputSchema":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"validationRules":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"implementationType":{"type":["string","null"],"enum":["Function","Inngest-step","Inngest-step-wrapped",null]},"retryable":{"type":["boolean","null"]},"timeout":{"type":["string","null"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","actionId","versionNumber","state","inputSchema","outputSchema","validationRules","implementationType","retryable","timeout","sourceFileChecksum","sourceSyncRunId","createdAt","updatedAt","deletedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"ActionVersion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflows":{"get":{"summary":"List Workflows","tags":["Workflow"],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"default":50,"description":"Maximum number of workflows to return (max 200; default 50)"},"required":false,"description":"Maximum number of workflows to return (max 200; default 50)","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of workflows to skip"},"required":false,"description":"Number of workflows to skip","name":"offset","in":"query"},{"schema":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}]},"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published"},"required":false,"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published","name":"filter","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc"},"required":false,"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc","name":"sort","in":"query"}],"responses":{"200":{"description":"List of Workflows","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"engine":{"type":"string","enum":["flow","dwp"]},"schedule":{"type":["string","null"]},"teamId":{"type":"string"},"state":{"type":"string","enum":["draft","published"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"latestVersionId":{"type":["string","null"]},"publishedVersionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","description","engine","schedule","teamId","state","metadata","latestVersionId","publishedVersionId","createdAt","updatedAt","deletedAt"]}}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Requested team is not permitted for this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Create new Workflow","tags":["Workflow"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"description":{"type":["string","null"]},"engine":{"type":"string","enum":["flow","dwp"]},"schedule":{"type":["string","null"]},"teamId":{"type":"string","minLength":1},"state":{"type":"string","enum":["draft","published"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"latestVersionId":{"type":["string","null"]},"publishedVersionId":{"type":["string","null"]}},"required":["name","title","teamId"]}}}},"responses":{"201":{"description":"Workflow created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"engine":{"type":"string","enum":["flow","dwp"]},"schedule":{"type":["string","null"]},"teamId":{"type":"string"},"state":{"type":"string","enum":["draft","published"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"latestVersionId":{"type":["string","null"]},"publishedVersionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","description","engine","schedule","teamId","state","metadata","latestVersionId","publishedVersionId","createdAt","updatedAt","deletedAt"]}}}}}}},"/api/v1/workflows/{id}":{"get":{"summary":"Get Workflow by ID","tags":["Workflow"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Workflow details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"engine":{"type":"string","enum":["flow","dwp"]},"schedule":{"type":["string","null"]},"teamId":{"type":"string"},"state":{"type":"string","enum":["draft","published"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"latestVersionId":{"type":["string","null"]},"publishedVersionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","description","engine","schedule","teamId","state","metadata","latestVersionId","publishedVersionId","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"summary":"Update Workflow by ID","tags":["Workflow"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"description":{"type":["string","null"]},"engine":{"type":"string","enum":["flow","dwp"]},"schedule":{"type":["string","null"]},"teamId":{"type":"string","minLength":1},"state":{"type":"string","enum":["draft","published"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"latestVersionId":{"type":["string","null"]},"publishedVersionId":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"Workflow updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"engine":{"type":"string","enum":["flow","dwp"]},"schedule":{"type":["string","null"]},"teamId":{"type":"string"},"state":{"type":"string","enum":["draft","published"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"latestVersionId":{"type":["string","null"]},"publishedVersionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","description","engine","schedule","teamId","state","metadata","latestVersionId","publishedVersionId","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Delete Workflow by ID","tags":["Workflow"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Workflow deleted"},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflows/{id}/versions":{"get":{"summary":"ListVersions Workflow","tags":["Workflow"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"List every version of the workflow (newest first) with per-version node counts","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["draft","published","archived"]},"title":{"type":"string"},"description":{"type":["string","null"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"engine":{"type":"string","enum":["flow","dwp"]},"graphHash":{"type":"string"},"sourceType":{"type":"string","enum":["ui","sync"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"},"publishNotes":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"nodeCount":{"type":"number"}},"required":["id","workflowId","versionNumber","state","title","description","metadata","engine","graphHash","sourceType","sourceFileChecksum","sourceSyncRunId","publishedAt","publishNotes","createdAt","updatedAt","deletedAt","nodeCount"]}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflows/{id}/createVersion":{"post":{"summary":"CreateVersion Workflow","tags":["Workflow"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sourceVersionId":{"type":"string"}}}}}},"responses":{"200":{"description":"Create a new draft version copying a source version graph (defaults to the latest version)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["draft","published","archived"]},"title":{"type":"string"},"description":{"type":["string","null"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"engine":{"type":"string","enum":["flow","dwp"]},"graphHash":{"type":"string"},"sourceType":{"type":"string","enum":["ui","sync"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"},"publishNotes":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","versionNumber","state","title","description","metadata","engine","graphHash","sourceType","sourceFileChecksum","sourceSyncRunId","publishedAt","publishNotes","createdAt","updatedAt","deletedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflows/{id}/publish":{"post":{"summary":"Publish Workflow","tags":["Workflow"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Publish workflow from draft state","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"engine":{"type":"string","enum":["flow","dwp"]},"schedule":{"type":["string","null"]},"teamId":{"type":"string"},"state":{"type":"string","enum":["draft","published"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"latestVersionId":{"type":["string","null"]},"publishedVersionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","description","engine","schedule","teamId","state","metadata","latestVersionId","publishedVersionId","createdAt","updatedAt","deletedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflows/{id}/unpublish":{"post":{"summary":"Unpublish Workflow","tags":["Workflow"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Unpublish workflow back to draft state","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"engine":{"type":"string","enum":["flow","dwp"]},"schedule":{"type":["string","null"]},"teamId":{"type":"string"},"state":{"type":"string","enum":["draft","published"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"latestVersionId":{"type":["string","null"]},"publishedVersionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","title","description","engine","schedule","teamId","state","metadata","latestVersionId","publishedVersionId","createdAt","updatedAt","deletedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflows/{id}/start":{"post":{"summary":"Start Workflow","tags":["Workflow"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"metadata":{"type":"object","additionalProperties":{}}}}}}},"responses":{"200":{"description":"Create and start a new workflow instance","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"teamId":{"type":"string"},"executionId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"output":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"state":{"type":"string","enum":["pending","running","paused","waiting","completed","canceled","failed"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"workflowEventId":{"type":["string","null"]},"deletedAt":{"type":["string","null"],"format":"date-time"},"engineBuild":{"type":["string","null"]},"runTags":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}},"required":["id","name","workflowId","workflowVersionId","teamId","executionId","metadata","output","state","startedAt","completedAt","createdAt","updatedAt","workflowEventId","deletedAt","engineBuild","runTags"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflows/{id}/dwp-config":{"get":{"summary":"GetDwpConfig Workflow","tags":["Workflow"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"versionId","in":"query"}],"responses":{"200":{"description":"Return the workflow config in dwp execution shape (steps[], connections[], batchConfig, etc.). Used by the engine's engine/dispatch-by-id adapter to look up a workflow by ID.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowEvents":{"get":{"summary":"List Workflow Events","tags":["Workflow Event"],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"default":50,"description":"Maximum number of workflow events to return (max 200; default 50)"},"required":false,"description":"Maximum number of workflow events to return (max 200; default 50)","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of workflow events to skip"},"required":false,"description":"Number of workflow events to skip","name":"offset","in":"query"},{"schema":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}]},"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published"},"required":false,"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published","name":"filter","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc"},"required":false,"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc","name":"sort","in":"query"}],"responses":{"200":{"description":"List of Workflow Events","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":["string","null"]},"teamId":{"type":"string"},"title":{"type":"string"},"cron":{"type":"string"},"timezone":{"type":"string"},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"skipIfRunning":{"type":"boolean"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"nextRunAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","teamId","title","cron","timezone","description","enabled","skipIfRunning","lastRunAt","nextRunAt","createdAt","updatedAt","deletedAt"]}}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Requested team is not permitted for this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Create new Workflow Event","tags":["Workflow Event"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflowId":{"type":"string","minLength":1},"workflowVersionId":{"type":["string","null"]},"teamId":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"cron":{"type":"string","minLength":1},"timezone":{"type":"string"},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"skipIfRunning":{"type":"boolean"}},"required":["workflowId","teamId","title","cron"]}}}},"responses":{"201":{"description":"Workflow Event created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":["string","null"]},"teamId":{"type":"string"},"title":{"type":"string"},"cron":{"type":"string"},"timezone":{"type":"string"},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"skipIfRunning":{"type":"boolean"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"nextRunAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","teamId","title","cron","timezone","description","enabled","skipIfRunning","lastRunAt","nextRunAt","createdAt","updatedAt","deletedAt"]}}}}}}},"/api/v1/workflowEvents/{id}":{"get":{"summary":"Get Workflow Event by ID","tags":["Workflow Event"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Workflow Event details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":["string","null"]},"teamId":{"type":"string"},"title":{"type":"string"},"cron":{"type":"string"},"timezone":{"type":"string"},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"skipIfRunning":{"type":"boolean"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"nextRunAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","teamId","title","cron","timezone","description","enabled","skipIfRunning","lastRunAt","nextRunAt","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"Workflow Event not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"summary":"Update Workflow Event by ID","tags":["Workflow Event"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflowId":{"type":"string","minLength":1},"workflowVersionId":{"type":["string","null"]},"teamId":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"cron":{"type":"string","minLength":1},"timezone":{"type":"string"},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"skipIfRunning":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Workflow Event updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":["string","null"]},"teamId":{"type":"string"},"title":{"type":"string"},"cron":{"type":"string"},"timezone":{"type":"string"},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"skipIfRunning":{"type":"boolean"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"nextRunAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","teamId","title","cron","timezone","description","enabled","skipIfRunning","lastRunAt","nextRunAt","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"Workflow Event not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Delete Workflow Event by ID","tags":["Workflow Event"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Workflow Event deleted"},"404":{"description":"Workflow Event not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowEvents/{id}/enable":{"post":{"summary":"Enable Workflow Event","tags":["Workflow Event"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Enable a WorkflowEvent schedule","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":["string","null"]},"teamId":{"type":"string"},"title":{"type":"string"},"cron":{"type":"string"},"timezone":{"type":"string"},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"skipIfRunning":{"type":"boolean"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"nextRunAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","teamId","title","cron","timezone","description","enabled","skipIfRunning","lastRunAt","nextRunAt","createdAt","updatedAt","deletedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow Event not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowEvents/{id}/disable":{"post":{"summary":"Disable Workflow Event","tags":["Workflow Event"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Disable a WorkflowEvent schedule","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":["string","null"]},"teamId":{"type":"string"},"title":{"type":"string"},"cron":{"type":"string"},"timezone":{"type":"string"},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"skipIfRunning":{"type":"boolean"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"nextRunAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","teamId","title","cron","timezone","description","enabled","skipIfRunning","lastRunAt","nextRunAt","createdAt","updatedAt","deletedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow Event not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowEvents/{id}/pin":{"post":{"summary":"Pin Workflow Event","tags":["Workflow Event"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflowVersionId":{"type":"string","minLength":1}},"required":["workflowVersionId"]}}}},"responses":{"200":{"description":"Pin the schedule to a concrete workflow version","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":["string","null"]},"teamId":{"type":"string"},"title":{"type":"string"},"cron":{"type":"string"},"timezone":{"type":"string"},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"skipIfRunning":{"type":"boolean"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"nextRunAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","teamId","title","cron","timezone","description","enabled","skipIfRunning","lastRunAt","nextRunAt","createdAt","updatedAt","deletedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow Event not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowEvents/{id}/unpin":{"post":{"summary":"Unpin Workflow Event","tags":["Workflow Event"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Unpin the schedule back to floating (fires the published version)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":["string","null"]},"teamId":{"type":"string"},"title":{"type":"string"},"cron":{"type":"string"},"timezone":{"type":"string"},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"skipIfRunning":{"type":"boolean"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"nextRunAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","teamId","title","cron","timezone","description","enabled","skipIfRunning","lastRunAt","nextRunAt","createdAt","updatedAt","deletedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow Event not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowInstances":{"get":{"summary":"List Workflow Instances","tags":["Workflow Instance"],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"default":50,"description":"Maximum number of workflow instances to return (max 200; default 50)"},"required":false,"description":"Maximum number of workflow instances to return (max 200; default 50)","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of workflow instances to skip"},"required":false,"description":"Number of workflow instances to skip","name":"offset","in":"query"},{"schema":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}]},"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published"},"required":false,"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published","name":"filter","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc"},"required":false,"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc","name":"sort","in":"query"}],"responses":{"200":{"description":"List of Workflow Instances","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"teamId":{"type":"string"},"executionId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"output":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"state":{"type":"string","enum":["pending","running","paused","waiting","completed","canceled","failed"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"workflowEventId":{"type":["string","null"]},"deletedAt":{"type":["string","null"],"format":"date-time"},"engineBuild":{"type":["string","null"]},"runTags":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}},"required":["id","name","workflowId","workflowVersionId","teamId","executionId","metadata","output","state","startedAt","completedAt","createdAt","updatedAt","workflowEventId","deletedAt","engineBuild","runTags"]}}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Requested team is not permitted for this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Create new Workflow Instance","tags":["Workflow Instance"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"workflowId":{"type":"string","minLength":1},"workflowVersionId":{"type":"string"},"teamId":{"type":"string","minLength":1},"executionId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"output":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"state":{"type":"string","enum":["pending","running","paused","waiting","completed","canceled"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"workflowEventId":{"type":["string","null"]},"engineBuild":{"type":["string","null"]},"runTags":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}},"required":["name","workflowId","teamId"]}}}},"responses":{"201":{"description":"Workflow Instance created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"teamId":{"type":"string"},"executionId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"output":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"state":{"type":"string","enum":["pending","running","paused","waiting","completed","canceled","failed"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"workflowEventId":{"type":["string","null"]},"deletedAt":{"type":["string","null"],"format":"date-time"},"engineBuild":{"type":["string","null"]},"runTags":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}},"required":["id","name","workflowId","workflowVersionId","teamId","executionId","metadata","output","state","startedAt","completedAt","createdAt","updatedAt","workflowEventId","deletedAt","engineBuild","runTags"]}}}}}}},"/api/v1/workflowInstances/{id}":{"get":{"summary":"Get Workflow Instance by ID","tags":["Workflow Instance"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Comma-separated expansions: outputs"},"required":false,"description":"Comma-separated expansions: outputs","name":"include","in":"query"}],"responses":{"200":{"description":"Workflow Instance details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"teamId":{"type":"string"},"executionId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"output":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"state":{"type":"string","enum":["pending","running","paused","waiting","completed","canceled","failed"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"workflowEventId":{"type":["string","null"]},"deletedAt":{"type":["string","null"],"format":"date-time"},"engineBuild":{"type":["string","null"]},"runTags":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}},"required":["id","name","workflowId","workflowVersionId","teamId","executionId","metadata","output","state","startedAt","completedAt","createdAt","updatedAt","workflowEventId","deletedAt","engineBuild","runTags"]}}}},"404":{"description":"Workflow Instance not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"summary":"Update Workflow Instance by ID","tags":["Workflow Instance"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"workflowId":{"type":"string","minLength":1},"workflowVersionId":{"type":"string"},"teamId":{"type":"string","minLength":1},"executionId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"output":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"state":{"type":"string","enum":["pending","running","paused","waiting","completed","canceled"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"workflowEventId":{"type":["string","null"]},"engineBuild":{"type":["string","null"]},"runTags":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}}}}}},"responses":{"200":{"description":"Workflow Instance updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"teamId":{"type":"string"},"executionId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"output":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"state":{"type":"string","enum":["pending","running","paused","waiting","completed","canceled","failed"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"workflowEventId":{"type":["string","null"]},"deletedAt":{"type":["string","null"],"format":"date-time"},"engineBuild":{"type":["string","null"]},"runTags":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}},"required":["id","name","workflowId","workflowVersionId","teamId","executionId","metadata","output","state","startedAt","completedAt","createdAt","updatedAt","workflowEventId","deletedAt","engineBuild","runTags"]}}}},"404":{"description":"Workflow Instance not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Delete Workflow Instance by ID","tags":["Workflow Instance"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Workflow Instance deleted"},"404":{"description":"Workflow Instance not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowInstances/{id}/start":{"post":{"summary":"Start Workflow Instance","tags":["Workflow Instance"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Start a pending or paused workflow instance","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"teamId":{"type":"string"},"executionId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"output":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"state":{"type":"string","enum":["pending","running","paused","waiting","completed","canceled","failed"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"workflowEventId":{"type":["string","null"]},"deletedAt":{"type":["string","null"],"format":"date-time"},"engineBuild":{"type":["string","null"]},"runTags":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}},"required":["id","name","workflowId","workflowVersionId","teamId","executionId","metadata","output","state","startedAt","completedAt","createdAt","updatedAt","workflowEventId","deletedAt","engineBuild","runTags"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow Instance not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowInstances/{id}/pause":{"post":{"summary":"Pause Workflow Instance","tags":["Workflow Instance"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Pause a running workflow instance","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"teamId":{"type":"string"},"executionId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"output":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"state":{"type":"string","enum":["pending","running","paused","waiting","completed","canceled","failed"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"workflowEventId":{"type":["string","null"]},"deletedAt":{"type":["string","null"],"format":"date-time"},"engineBuild":{"type":["string","null"]},"runTags":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}},"required":["id","name","workflowId","workflowVersionId","teamId","executionId","metadata","output","state","startedAt","completedAt","createdAt","updatedAt","workflowEventId","deletedAt","engineBuild","runTags"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow Instance not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowInstances/{id}/resume":{"post":{"summary":"Resume Workflow Instance","tags":["Workflow Instance"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Resume a paused or waiting workflow instance","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"teamId":{"type":"string"},"executionId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"output":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"state":{"type":"string","enum":["pending","running","paused","waiting","completed","canceled","failed"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"workflowEventId":{"type":["string","null"]},"deletedAt":{"type":["string","null"],"format":"date-time"},"engineBuild":{"type":["string","null"]},"runTags":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}},"required":["id","name","workflowId","workflowVersionId","teamId","executionId","metadata","output","state","startedAt","completedAt","createdAt","updatedAt","workflowEventId","deletedAt","engineBuild","runTags"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow Instance not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowInstances/{id}/wait":{"post":{"summary":"Wait Workflow Instance","tags":["Workflow Instance"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"metadata":{"type":"object","additionalProperties":{}}}}}}},"responses":{"200":{"description":"Set a running workflow instance to waiting state with optional approval metadata","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"teamId":{"type":"string"},"executionId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"output":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"state":{"type":"string","enum":["pending","running","paused","waiting","completed","canceled","failed"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"workflowEventId":{"type":["string","null"]},"deletedAt":{"type":["string","null"],"format":"date-time"},"engineBuild":{"type":["string","null"]},"runTags":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}},"required":["id","name","workflowId","workflowVersionId","teamId","executionId","metadata","output","state","startedAt","completedAt","createdAt","updatedAt","workflowEventId","deletedAt","engineBuild","runTags"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow Instance not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowInstances/{id}/complete":{"post":{"summary":"Complete Workflow Instance","tags":["Workflow Instance"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Mark a workflow instance as completed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"teamId":{"type":"string"},"executionId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"output":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"state":{"type":"string","enum":["pending","running","paused","waiting","completed","canceled","failed"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"workflowEventId":{"type":["string","null"]},"deletedAt":{"type":["string","null"],"format":"date-time"},"engineBuild":{"type":["string","null"]},"runTags":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}},"required":["id","name","workflowId","workflowVersionId","teamId","executionId","metadata","output","state","startedAt","completedAt","createdAt","updatedAt","workflowEventId","deletedAt","engineBuild","runTags"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow Instance not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowInstances/{id}/cancel":{"post":{"summary":"Cancel Workflow Instance","tags":["Workflow Instance"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Cancel a workflow instance","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"teamId":{"type":"string"},"executionId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"output":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"state":{"type":"string","enum":["pending","running","paused","waiting","completed","canceled","failed"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"workflowEventId":{"type":["string","null"]},"deletedAt":{"type":["string","null"],"format":"date-time"},"engineBuild":{"type":["string","null"]},"runTags":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}},"required":["id","name","workflowId","workflowVersionId","teamId","executionId","metadata","output","state","startedAt","completedAt","createdAt","updatedAt","workflowEventId","deletedAt","engineBuild","runTags"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow Instance not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowNodes":{"get":{"summary":"List Workflow Nodes","tags":["Workflow Node"],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"default":50,"description":"Maximum number of workflow nodes to return (max 200; default 50)"},"required":false,"description":"Maximum number of workflow nodes to return (max 200; default 50)","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of workflow nodes to skip"},"required":false,"description":"Number of workflow nodes to skip","name":"offset","in":"query"},{"schema":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}]},"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published"},"required":false,"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published","name":"filter","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc"},"required":false,"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc","name":"sort","in":"query"}],"responses":{"200":{"description":"List of Workflow Nodes","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"actionVersionId":{"type":"string"},"nodeKey":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"inputs":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","actionVersionId","nodeKey","name","title","inputs","metadata","createdAt","updatedAt","deletedAt"]}}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Requested team is not permitted for this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Create new Workflow Node","tags":["Workflow Node"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflowId":{"type":"string","minLength":1},"workflowVersionId":{"type":"string"},"actionVersionId":{"type":"string"},"nodeKey":{"type":"string"},"name":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"inputs":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"metadata":{"type":"object","properties":{"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},"additionalProperties":{}},"actionId":{"type":"string","minLength":1}},"required":["workflowId","name","title","actionId"]}}}},"responses":{"201":{"description":"Workflow Node created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"actionVersionId":{"type":"string"},"nodeKey":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"inputs":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","actionVersionId","nodeKey","name","title","inputs","metadata","createdAt","updatedAt","deletedAt"]}}}}}}},"/api/v1/workflowNodes/{id}":{"get":{"summary":"Get Workflow Node by ID","tags":["Workflow Node"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Workflow Node details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"actionVersionId":{"type":"string"},"nodeKey":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"inputs":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","actionVersionId","nodeKey","name","title","inputs","metadata","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"Workflow Node not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"summary":"Update Workflow Node by ID","tags":["Workflow Node"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflowId":{"type":"string","minLength":1},"workflowVersionId":{"type":"string"},"actionVersionId":{"type":"string"},"nodeKey":{"type":"string"},"name":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"inputs":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"metadata":{"type":"object","properties":{"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},"additionalProperties":{}},"actionId":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":"Workflow Node updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"actionVersionId":{"type":"string"},"nodeKey":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"inputs":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","actionVersionId","nodeKey","name","title","inputs","metadata","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"Workflow Node not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Delete Workflow Node by ID","tags":["Workflow Node"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Workflow Node deleted"},"404":{"description":"Workflow Node not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowNodes/{id}/upgradeAction":{"post":{"summary":"UpgradeAction Workflow Node","tags":["Workflow Node"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Swap the node's pinned actionVersionId to the action's latest published version (preserves inputs)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"actionVersionId":{"type":"string"},"nodeKey":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"inputs":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","actionVersionId","nodeKey","name","title","inputs","metadata","createdAt","updatedAt","deletedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Workflow Node not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowEdges":{"get":{"summary":"List Workflow Edges","tags":["Workflow Edge"],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"default":50,"description":"Maximum number of workflow edges to return (max 200; default 50)"},"required":false,"description":"Maximum number of workflow edges to return (max 200; default 50)","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of workflow edges to skip"},"required":false,"description":"Number of workflow edges to skip","name":"offset","in":"query"},{"schema":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}]},"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published"},"required":false,"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published","name":"filter","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc"},"required":false,"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc","name":"sort","in":"query"}],"responses":{"200":{"description":"List of Workflow Edges","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"fromNodeId":{"type":["string","null"]},"toNodeId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","fromNodeId","toNodeId","metadata","createdAt","updatedAt","deletedAt"]}}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Requested team is not permitted for this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Create new Workflow Edge","tags":["Workflow Edge"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflowId":{"type":"string","minLength":1},"workflowVersionId":{"type":"string"},"fromNodeId":{"type":["string","null"]},"toNodeId":{"type":"string","minLength":1},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}},"required":["workflowId","toNodeId"]}}}},"responses":{"201":{"description":"Workflow Edge created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"fromNodeId":{"type":["string","null"]},"toNodeId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","fromNodeId","toNodeId","metadata","createdAt","updatedAt","deletedAt"]}}}}}}},"/api/v1/workflowEdges/{id}":{"get":{"summary":"Get Workflow Edge by ID","tags":["Workflow Edge"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Workflow Edge details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"fromNodeId":{"type":["string","null"]},"toNodeId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","fromNodeId","toNodeId","metadata","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"Workflow Edge not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"summary":"Update Workflow Edge by ID","tags":["Workflow Edge"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflowId":{"type":"string","minLength":1},"workflowVersionId":{"type":"string"},"fromNodeId":{"type":["string","null"]},"toNodeId":{"type":"string","minLength":1},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]}}}}}},"responses":{"200":{"description":"Workflow Edge updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":"string"},"fromNodeId":{"type":["string","null"]},"toNodeId":{"type":"string"},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","fromNodeId","toNodeId","metadata","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"Workflow Edge not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Delete Workflow Edge by ID","tags":["Workflow Edge"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Workflow Edge deleted"},"404":{"description":"Workflow Edge not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowVersions":{"get":{"summary":"List Workflow Versions","tags":["WorkflowVersion"],"parameters":[{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"default":50,"description":"Maximum number of workflow versions to return (max 200; default 50)"},"required":false,"description":"Maximum number of workflow versions to return (max 200; default 50)","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of workflow versions to skip"},"required":false,"description":"Number of workflow versions to skip","name":"offset","in":"query"},{"schema":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}]},"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published"},"required":false,"description":"Filter by field values. Supports operators: eq, ne, gt, gte, lt, lte. Examples: filter[teamId]=abc123, filter[price][gt]=99, filter[state]=draft&filter[state]=published","name":"filter","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc"},"required":false,"description":"Sort by field(s). Format: field:direction (asc or desc). Examples: sort[0]=createdAt:desc, sort[1]=name:asc","name":"sort","in":"query"}],"responses":{"200":{"description":"List of Workflow Versions","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["draft","published","archived"]},"title":{"type":"string"},"description":{"type":["string","null"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"engine":{"type":"string","enum":["flow","dwp"]},"graphHash":{"type":"string"},"sourceType":{"type":"string","enum":["ui","sync"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"},"publishNotes":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","versionNumber","state","title","description","metadata","engine","graphHash","sourceType","sourceFileChecksum","sourceSyncRunId","publishedAt","publishNotes","createdAt","updatedAt","deletedAt"]}}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Requested team is not permitted for this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Create new WorkflowVersion","tags":["WorkflowVersion"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflowId":{"type":"string","minLength":1},"versionNumber":{"type":"integer","exclusiveMinimum":0},"state":{"type":"string","enum":["draft","published","archived"]},"title":{"type":"string","minLength":1},"description":{"type":["string","null"]},"metadata":{},"engine":{"type":"string","enum":["flow","dwp"]},"graphHash":{"type":["string","null"]},"sourceType":{"type":"string","enum":["ui","sync"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"},"publishNotes":{"type":["string","null"]}},"required":["workflowId","versionNumber","title"]}}}},"responses":{"201":{"description":"WorkflowVersion created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["draft","published","archived"]},"title":{"type":"string"},"description":{"type":["string","null"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"engine":{"type":"string","enum":["flow","dwp"]},"graphHash":{"type":"string"},"sourceType":{"type":"string","enum":["ui","sync"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"},"publishNotes":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","versionNumber","state","title","description","metadata","engine","graphHash","sourceType","sourceFileChecksum","sourceSyncRunId","publishedAt","publishNotes","createdAt","updatedAt","deletedAt"]}}}}}}},"/api/v1/workflowVersions/{id}":{"get":{"summary":"Get WorkflowVersion by ID","tags":["WorkflowVersion"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"WorkflowVersion details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["draft","published","archived"]},"title":{"type":"string"},"description":{"type":["string","null"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"engine":{"type":"string","enum":["flow","dwp"]},"graphHash":{"type":"string"},"sourceType":{"type":"string","enum":["ui","sync"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"},"publishNotes":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","versionNumber","state","title","description","metadata","engine","graphHash","sourceType","sourceFileChecksum","sourceSyncRunId","publishedAt","publishNotes","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"WorkflowVersion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"summary":"Update WorkflowVersion by ID","tags":["WorkflowVersion"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflowId":{"type":"string","minLength":1},"versionNumber":{"type":"integer","exclusiveMinimum":0},"state":{"type":"string","enum":["draft","published","archived"]},"title":{"type":"string","minLength":1},"description":{"type":["string","null"]},"metadata":{},"engine":{"type":"string","enum":["flow","dwp"]},"graphHash":{"type":["string","null"]},"sourceType":{"type":"string","enum":["ui","sync"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"},"publishNotes":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"WorkflowVersion updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["draft","published","archived"]},"title":{"type":"string"},"description":{"type":["string","null"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"engine":{"type":"string","enum":["flow","dwp"]},"graphHash":{"type":"string"},"sourceType":{"type":"string","enum":["ui","sync"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"},"publishNotes":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","versionNumber","state","title","description","metadata","engine","graphHash","sourceType","sourceFileChecksum","sourceSyncRunId","publishedAt","publishNotes","createdAt","updatedAt","deletedAt"]}}}},"404":{"description":"WorkflowVersion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Delete WorkflowVersion by ID","tags":["WorkflowVersion"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"WorkflowVersion deleted"},"404":{"description":"WorkflowVersion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowVersions/{id}/pinned-schedules":{"get":{"summary":"ListPinnedSchedules WorkflowVersion","tags":["WorkflowVersion"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"List the enabled schedules pinned to this workflow version (for the pre-archive warning modal)","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowVersionId":{"type":["string","null"]},"teamId":{"type":"string"},"title":{"type":"string"},"cron":{"type":"string"},"timezone":{"type":"string"},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"skipIfRunning":{"type":"boolean"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"nextRunAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","workflowVersionId","teamId","title","cron","timezone","description","enabled","skipIfRunning","lastRunAt","nextRunAt","createdAt","updatedAt","deletedAt"]}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"WorkflowVersion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowVersions/{id}/publish":{"post":{"summary":"Publish WorkflowVersion","tags":["WorkflowVersion"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Publish a draft workflow version (runs the pre-publish validation gate)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["draft","published","archived"]},"title":{"type":"string"},"description":{"type":["string","null"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"engine":{"type":"string","enum":["flow","dwp"]},"graphHash":{"type":"string"},"sourceType":{"type":"string","enum":["ui","sync"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"},"publishNotes":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","versionNumber","state","title","description","metadata","engine","graphHash","sourceType","sourceFileChecksum","sourceSyncRunId","publishedAt","publishNotes","createdAt","updatedAt","deletedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"WorkflowVersion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowVersions/{id}/archive":{"post":{"summary":"Archive WorkflowVersion","tags":["WorkflowVersion"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Archive a workflow version","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"versionNumber":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"state":{"type":"string","enum":["draft","published","archived"]},"title":{"type":"string"},"description":{"type":["string","null"]},"metadata":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"engine":{"type":"string","enum":["flow","dwp"]},"graphHash":{"type":"string"},"sourceType":{"type":"string","enum":["ui","sync"]},"sourceFileChecksum":{"type":["string","null"]},"sourceSyncRunId":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"},"publishNotes":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","workflowId","versionNumber","state","title","description","metadata","engine","graphHash","sourceType","sourceFileChecksum","sourceSyncRunId","publishedAt","publishNotes","createdAt","updatedAt","deletedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"WorkflowVersion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/workflowVersions/{id}/validate":{"get":{"summary":"Validate WorkflowVersion","tags":["WorkflowVersion"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Dry-run the pre-publish validation gate for a version (no mutation); used by the builder to enable/disable the Publish button","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"failures":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["ok","failures"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"WorkflowVersion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/statistics":{"get":{"tags":["Statistics"],"summary":"Get workflow instance statistics","description":"Returns current week vs prior week statistics for completed and active flows","parameters":[{"schema":{"type":"string","description":"Filter statistics by team ID"},"required":false,"description":"Filter statistics by team ID","name":"teamId","in":"query"}],"responses":{"200":{"description":"Statistics retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"completedWorkflows":{"type":"object","properties":{"currentWeek":{"type":"object","properties":{"count":{"type":"number"},"startDate":{"type":"string"},"endDate":{"type":"string"},"dailyBreakdown":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"number"}},"required":["date","count"]}}},"required":["count","startDate","endDate","dailyBreakdown"]},"priorWeek":{"type":"object","properties":{"count":{"type":"number"},"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["count","startDate","endDate"]},"percentageChange":{"type":"number"}},"required":["currentWeek","priorWeek","percentageChange"]},"activeWorkflows":{"type":"object","properties":{"currentWeek":{"type":"object","properties":{"count":{"type":"number"},"breakdown":{"type":"object","properties":{"running":{"type":"number"},"paused":{"type":"number"},"waiting":{"type":"number"}},"required":["running","paused","waiting"]},"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["count","breakdown","startDate","endDate"]},"priorWeek":{"type":"object","properties":{"count":{"type":"number"},"breakdown":{"type":"object","properties":{"running":{"type":"number"},"paused":{"type":"number"},"waiting":{"type":"number"}},"required":["running","paused","waiting"]},"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["count","breakdown","startDate","endDate"]},"percentageChange":{"type":"number"}},"required":["currentWeek","priorWeek","percentageChange"]},"generatedAt":{"type":"string"}},"required":["completedWorkflows","activeWorkflows","generatedAt"]}}}},"403":{"description":"Requested team is not permitted for this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}},"webhooks":{}}