http
POST /projects/{project_reference}/workflowsCreate a workflow source file in the project source or a preview branch when a new multi-step process must be runnable or schedulable; returns the workflow source document. Requires project.runs.write.
Servers
JSON
1[2 {3 "url": "https://api.veryfront.com"4 }5]Authentication
JSON
1[2 {3 "bearerAuth": []4 },5 {6 "apiKeyAuth": []7 }8]JSON
1{2 "bearerAuth": {3 "type": "http",4 "scheme": "bearer",5 "bearerFormat": "JWT or API Key",6 "description": "Use a JWT bearer token or a Veryfront API key in the `Authorization` header."7 },8 "apiKeyAuth": {9 "type": "apiKey",10 "in": "header",11 "name": "X-API-Key",12 "description": "Alternative API key header for `vf_<prefix>_<secret>` tokens."13 }14}Parameters
| Name | Location | Required | Description |
|---|---|---|---|
| project_reference | path | Yes | Project slug, UUID, or domain that identifies the project. |
| source_target_kind | query | No | |
| target_branch_id | query | No |
Parameter contracts
JSON
1[2 {3 "schema": {4 "$ref": "#/components/schemas/ProjectReference"5 },6 "required": true,7 "description": "Project slug, UUID, or domain that identifies the project.",8 "name": "project_reference",9 "in": "path"10 },11 {12 "schema": {13 "type": "string"14 },15 "required": false,16 "name": "source_target_kind",17 "in": "query"18 },19 {20 "schema": {21 "type": [22 "string",23 "null"24 ],25 "format": "uuid"26 },27 "required": false,28 "name": "target_branch_id",29 "in": "query"30 }31]Request body
JSON
1{2 "required": true,3 "content": {4 "application/json": {5 "schema": {6 "type": "object",7 "properties": {8 "id": {9 "type": "string",10 "minLength": 1,11 "maxLength": 128,12 "pattern": "^[a-z0-9][a-z0-9-]*$",13 "description": "Stable workflow identifier used in MCP and project source."14 },15 "description": {16 "type": [17 "string",18 "null"19 ],20 "description": "Optional short description of what the workflow does."21 },22 "version": {23 "type": [24 "string",25 "null"26 ],27 "description": "Optional workflow version string."28 },29 "schedulable": {30 "type": "boolean",31 "description": "Whether the workflow can be triggered by schedulers."32 }33 },34 "required": [35 "id"36 ]37 }38 }39 }40}Responses
201
Created workflow document
JSON
1{2 "description": "Created workflow document",3 "content": {4 "application/json": {5 "schema": {6 "type": "object",7 "properties": {8 "id": {9 "type": "string",10 "description": "Workflow identifier."11 },12 "name": {13 "type": "string",14 "description": "Human-readable workflow name."15 },16 "description": {17 "type": [18 "string",19 "null"20 ],21 "description": "Short description of the workflow purpose."22 },23 "target": {24 "type": "string",25 "description": "Execution target that implements the workflow."26 },27 "source_path": {28 "type": "string",29 "description": "Source file path where the workflow definition lives."30 },31 "source": {32 "type": "string",33 "description": "Workflow source code or structured document content."34 },35 "version": {36 "type": [37 "string",38 "null"39 ],40 "description": "Version string for the workflow definition, when tracked."41 },42 "schedulable": {43 "type": "boolean",44 "description": "Whether the workflow can be triggered by schedulers."45 },46 "edit_mode": {47 "type": "string",48 "enum": [49 "structured",50 "source_only"51 ],52 "description": "Editing mode supported for the workflow definition."53 },54 "source_only_reasons": {55 "type": "array",56 "items": {57 "type": "string"58 },59 "description": "Reasons why the workflow can only be edited as raw source, when applicable."60 }61 },62 "required": [63 "id",64 "name",65 "description",66 "target",67 "source_path",68 "source",69 "version",70 "schedulable",71 "edit_mode",72 "source_only_reasons"73 ],74 "description": "Workflow definition including editable source content."75 }76 }77 }78}400
Bad request
JSON
1{2 "description": "Bad request",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/WorkflowProblem"7 }8 }9 }10}401
Unauthorized
JSON
1{2 "description": "Unauthorized",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/WorkflowProblem"7 }8 }9 }10}403
Forbidden
JSON
1{2 "description": "Forbidden",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/WorkflowProblem"7 }8 }9 }10}409
Conflict
JSON
1{2 "description": "Conflict",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/WorkflowProblem"7 }8 }9 }10}Referenced contracts
components/parameters/ProjectReference
JSON
1{2 "schema": {3 "$ref": "#/components/schemas/ProjectReference"4 },5 "required": true,6 "description": "Project slug, UUID, or domain that identifies the project.",7 "name": "project_reference",8 "in": "path"9}components/schemas/ProjectReference
JSON
1{2 "type": "string"3}components/schemas/WorkflowProblem
JSON
1{2 "allOf": [3 {4 "$ref": "#/components/schemas/Problem"5 },6 {7 "type": "object",8 "properties": {9 "edit_mode": {10 "type": "string",11 "enum": [12 "structured",13 "source_only"14 ],15 "description": "Edit mode of the workflow definition, on a source_only_conflict."16 },17 "source_only_reasons": {18 "type": "array",19 "items": {20 "type": "string"21 },22 "description": "Why the workflow can only be edited as raw source, on a source_only_conflict."23 },24 "source_path": {25 "type": "string",26 "description": "Source file of the workflow definition, on a source_only_conflict."27 }28 }29 }30 ]31}components/schemas/Problem
JSON
1{2 "type": "object",3 "properties": {4 "cause": {5 "type": "string",6 "enum": [7 "schedule_concurrency_forbidden",8 "schedule_fire_in_progress",9 "schedule_run_limit_reached"10 ],11 "description": "Schedule admission refusal."12 },13 "idempotency": {14 "type": "object",15 "properties": {16 "state": {17 "type": "string",18 "enum": [19 "in_progress",20 "payload_mismatch",21 "outcome_unknown"22 ]23 },24 "operation": {25 "type": "string",26 "minLength": 127 },28 "retryable": {29 "type": "boolean"30 },31 "retry_after_seconds": {32 "type": [33 "integer",34 "null"35 ],36 "minimum": 037 },38 "expires_at": {39 "type": [40 "string",41 "null"42 ]43 },44 "recovery": {45 "type": "object",46 "properties": {47 "available": {48 "type": "boolean"49 },50 "description": {51 "type": "string"52 },53 "resource_url": {54 "type": "string"55 }56 },57 "required": [58 "available",59 "description"60 ]61 }62 },63 "required": [64 "state",65 "operation",66 "retryable",67 "retry_after_seconds",68 "expires_at"69 ],70 "description": "Replay status, retry timing, and recovery lookup."71 },72 "type": {73 "type": "string",74 "description": "URI reference identifying the problem type",75 "example": "https://api.veryfront.com/errors/validation-failed"76 },77 "title": {78 "type": "string",79 "description": "Short human-readable summary of the problem",80 "example": "Validation Failed"81 },82 "status": {83 "type": "integer",84 "minimum": 100,85 "maximum": 599,86 "description": "HTTP status code",87 "example": 40088 },89 "code": {90 "type": "string",91 "description": "Stable machine-readable error code",92 "example": "RUN_INVALID_INPUT"93 },94 "detail": {95 "type": "string",96 "description": "Human-readable explanation specific to this occurrence",97 "example": "The 'email' field must be a valid email address"98 },99 "instance": {100 "type": "string",101 "description": "URI reference identifying the specific occurrence",102 "example": "/projects/my-project/members"103 },104 "slug": {105 "type": "string",106 "description": "Stable identifier for the problem type",107 "example": "validation-failed"108 },109 "category": {110 "type": "string",111 "enum": [112 "AUTH",113 "RESOURCE",114 "VALIDATION",115 "DATABASE",116 "SUBSCRIPTION",117 "INTEGRATION",118 "INTERNAL"119 ],120 "description": "API error category",121 "example": "VALIDATION"122 },123 "suggestion": {124 "type": "string",125 "description": "Suggested action to resolve the problem",126 "example": "Check the request body and query parameters against the API documentation."127 },128 "errors": {129 "type": "array",130 "items": {131 "type": "object",132 "properties": {133 "field": {134 "type": "string",135 "description": "Field path that caused the error",136 "example": "email"137 },138 "message": {139 "type": "string",140 "description": "Error message for this field",141 "example": "Invalid email format"142 },143 "code": {144 "type": "string",145 "description": "Error code for this field",146 "example": "INVALID_FORMAT"147 }148 },149 "required": [150 "field",151 "message"152 ]153 },154 "description": "Detailed field-level errors for validation failures"155 }156 },157 "required": [158 "type",159 "title",160 "status"161 ]162}Operation contract
JSON
1{2 "operationId": "createWorkflow",3 "tags": [4 "agents/Workflows/Workflows"5 ],6 "summary": "Create workflow",7 "description": "Create a workflow source file in the project source or a preview branch when a new multi-step process must be runnable or schedulable; returns the workflow source document. Requires project.runs.write.",8 "parameters": [9 {10 "$ref": "#/components/parameters/ProjectReference"11 },12 {13 "schema": {14 "type": "string"15 },16 "required": false,17 "name": "source_target_kind",18 "in": "query"19 },20 {21 "schema": {22 "type": [23 "string",24 "null"25 ],26 "format": "uuid"27 },28 "required": false,29 "name": "target_branch_id",30 "in": "query"31 }32 ],33 "requestBody": {34 "required": true,35 "content": {36 "application/json": {37 "schema": {38 "type": "object",39 "properties": {40 "id": {41 "type": "string",42 "minLength": 1,43 "maxLength": 128,44 "pattern": "^[a-z0-9][a-z0-9-]*$",45 "description": "Stable workflow identifier used in MCP and project source."46 },47 "description": {48 "type": [49 "string",50 "null"51 ],52 "description": "Optional short description of what the workflow does."53 },54 "version": {55 "type": [56 "string",57 "null"58 ],59 "description": "Optional workflow version string."60 },61 "schedulable": {62 "type": "boolean",63 "description": "Whether the workflow can be triggered by schedulers."64 }65 },66 "required": [67 "id"68 ]69 }70 }71 }72 },73 "responses": {74 "201": {75 "description": "Created workflow document",76 "content": {77 "application/json": {78 "schema": {79 "type": "object",80 "properties": {81 "id": {82 "type": "string",83 "description": "Workflow identifier."84 },85 "name": {86 "type": "string",87 "description": "Human-readable workflow name."88 },89 "description": {90 "type": [91 "string",92 "null"93 ],94 "description": "Short description of the workflow purpose."95 },96 "target": {97 "type": "string",98 "description": "Execution target that implements the workflow."99 },100 "source_path": {101 "type": "string",102 "description": "Source file path where the workflow definition lives."103 },104 "source": {105 "type": "string",106 "description": "Workflow source code or structured document content."107 },108 "version": {109 "type": [110 "string",111 "null"112 ],113 "description": "Version string for the workflow definition, when tracked."114 },115 "schedulable": {116 "type": "boolean",117 "description": "Whether the workflow can be triggered by schedulers."118 },119 "edit_mode": {120 "type": "string",121 "enum": [122 "structured",123 "source_only"124 ],125 "description": "Editing mode supported for the workflow definition."126 },127 "source_only_reasons": {128 "type": "array",129 "items": {130 "type": "string"131 },132 "description": "Reasons why the workflow can only be edited as raw source, when applicable."133 }134 },135 "required": [136 "id",137 "name",138 "description",139 "target",140 "source_path",141 "source",142 "version",143 "schedulable",144 "edit_mode",145 "source_only_reasons"146 ],147 "description": "Workflow definition including editable source content."148 }149 }150 }151 },152 "400": {153 "description": "Bad request",154 "content": {155 "application/problem+json": {156 "schema": {157 "$ref": "#/components/schemas/WorkflowProblem"158 }159 }160 }161 },162 "401": {163 "description": "Unauthorized",164 "content": {165 "application/problem+json": {166 "schema": {167 "$ref": "#/components/schemas/WorkflowProblem"168 }169 }170 }171 },172 "403": {173 "description": "Forbidden",174 "content": {175 "application/problem+json": {176 "schema": {177 "$ref": "#/components/schemas/WorkflowProblem"178 }179 }180 }181 },182 "409": {183 "description": "Conflict",184 "content": {185 "application/problem+json": {186 "schema": {187 "$ref": "#/components/schemas/WorkflowProblem"188 }189 }190 }191 }192 },193 "x-documentation-source-tag": "Project workflows",194 "x-canonical-documentation": {195 "domain": "agents",196 "resource": "Workflows",197 "subgroup": "Workflows",198 "name": "Create workflow",199 "description": "Create a workflow source file in the project source or a preview branch when a new multi-step process must be runnable or schedulable; returns the workflow source document. Requires project.runs.write.",200 "operationId": "createWorkflow"201 },202 "x-mint": {203 "href": "/cloud/rest/api-reference/agents-workflows-workflows/create-workflow"204 }205}