Create workflow

createWorkflow(projectReference: String!, input: CreateWorkflowInput!): WorkflowSource!

Requires project.runs.write.

Arguments

ArgumentTypeRequired
projectReferenceString!Yes
inputCreateWorkflowInput!Yes

Input fields

input

CreateWorkflowInput

FieldTypeRequiredDescription
idString!YesBecomes the file name and the workflow id; the workflow name is derived from it.
descriptionStringNo
versionStringNo
schedulableBooleanNoWhether a schedule can start the workflow; default true.
sourceTargetKindWriteTargetKindNoThe source to write; default project.
targetBranchIdIDNoRequired with the kind preview_branch.

Response

Returns WorkflowSource!. Open the type for its fields and nested types.

FieldTypeDescription
idID!
nameString!
descriptionString
targetString!
sourcePathString!
sourceString!The source text of the workflow file.
versionString
schedulableBoolean!

All fields of WorkflowSource.

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

query.graphql
mutation CreateWorkflow($projectReference: String!, $input: CreateWorkflowInput!) {  createWorkflow(projectReference: $projectReference, input: $input) {    id    name    description    editMode    schedulable  }}
variables.json
{  "projectReference": "00000000-0000-4000-8000-000000000001",  "input": {    "id": "example"  }}