> For the complete documentation index, see [llms.txt](https://glu.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://glu.gitbook.io/docs/api-reference/organisation-api/workflow.md).

# Workflow

A workflow run represents an execution instance of a workflow. It contains the execution history, status, and any errors that occurred during the run.

## List workflows

> Returns a list of workflows for the organisation, ordered by creation date with the most recent first.

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Workflow","description":"A workflow run represents an execution instance of a workflow. It contains the execution history, status, and any errors that occurred during the run."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Workflow-workflow.read":{"type":"object","description":"A workflow is an automated sequence of actions that can be triggered by various events. Workflows can be used to automate tasks such as sending emails, updating contact information, or triggering other actions based on customer behavior.","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"default":"Draft","type":"string","enum":["Draft","Active","Deleted"]},"startingTriggerType":{"type":["string","null"],"enum":["customer_created","gift_card_purchased","order_created","evaluate_membership_tier","contact_created","member_created","subscription_created","referral_completed","booking_created","booking_status_changed","webhook","date_anniversary","review_completed","contact_tag_changed",null]}}},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/workflows":{"get":{"operationId":"api_workflows_get_collection","tags":["Workflow"],"responses":{"200":{"description":"Workflow collection","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Workflow-workflow.read"}}}}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"List workflows","description":"Returns a list of workflows for the organisation, ordered by creation date with the most recent first.","parameters":[{"name":"page","in":"query","description":"The collection page number","required":false,"deprecated":false,"schema":{"type":"integer","default":1},"style":"form","explode":true}]}}}}
```

## Retrieve a workflow

> Retrieve details of a specific workflow by its ID.

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Workflow","description":"A workflow run represents an execution instance of a workflow. It contains the execution history, status, and any errors that occurred during the run."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Workflow-workflow.read":{"type":"object","description":"A workflow is an automated sequence of actions that can be triggered by various events. Workflows can be used to automate tasks such as sending emails, updating contact information, or triggering other actions based on customer behavior.","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"default":"Draft","type":"string","enum":["Draft","Active","Deleted"]},"startingTriggerType":{"type":["string","null"],"enum":["customer_created","gift_card_purchased","order_created","evaluate_membership_tier","contact_created","member_created","subscription_created","referral_completed","booking_created","booking_status_changed","webhook","date_anniversary","review_completed","contact_tag_changed",null]}}},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/workflows/{id}":{"get":{"operationId":"api_workflows_id_get","tags":["Workflow"],"responses":{"200":{"description":"Workflow resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow-workflow.read"}}}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"404":{"description":"Not found","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"Retrieve a workflow","description":"Retrieve details of a specific workflow by its ID.","parameters":[{"name":"id","in":"path","description":"Workflow identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false}]}}}}
```

## Delete a workflow

> Delete a workflow and all its associated data. This action cannot be undone.

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Workflow","description":"A workflow run represents an execution instance of a workflow. It contains the execution history, status, and any errors that occurred during the run."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/workflows/{id}":{"delete":{"operationId":"api_workflows_id_delete","tags":["Workflow"],"responses":{"204":{"description":"Workflow resource deleted"},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"404":{"description":"Not found","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"Delete a workflow","description":"Delete a workflow and all its associated data. This action cannot be undone.","parameters":[{"name":"id","in":"path","description":"Workflow identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false}]}}}}
```

## List workflow runs for a specific workflow

> Returns a list of workflow run executions for a specific workflow, ordered by creation date with the most recent first.

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Workflow","description":"A workflow run represents an execution instance of a workflow. It contains the execution history, status, and any errors that occurred during the run."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"WorkflowRun-workflow_run.read":{"type":"object","description":"A workflow run represents an execution instance of a workflow. It contains the execution history, status, and any errors that occurred during the run.","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"status":{"default":"running","type":"string","enum":["running","completed","failed","paused"]},"context":{"type":"array","items":{"type":["string","null"]}},"executedNodes":{"type":"array","items":{"type":"string"}},"errorMessage":{"type":["string","null"]},"triggerData":{"type":["string","null"]},"workflowId":{"readOnly":true,"type":["integer","null"]},"workflowName":{"readOnly":true,"type":["string","null"]}}},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/workflows/{workflowId}/runs":{"get":{"operationId":"api_workflows_workflowIdruns_get_collection","tags":["Workflow"],"responses":{"200":{"description":"WorkflowRun collection","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRun-workflow_run.read"}}}}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"List workflow runs for a specific workflow","description":"Returns a list of workflow run executions for a specific workflow, ordered by creation date with the most recent first.","parameters":[{"name":"workflowId","in":"path","description":"Workflow identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false},{"name":"page","in":"query","description":"The collection page number","required":false,"deprecated":false,"schema":{"type":"integer","default":1},"style":"form","explode":true}]}}}}
```

## Retrieve a workflow run

> Retrieve details of a specific workflow run execution by its ID, including execution history and status.

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Workflow","description":"A workflow run represents an execution instance of a workflow. It contains the execution history, status, and any errors that occurred during the run."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"WorkflowRun-workflow_run.read":{"type":"object","description":"A workflow run represents an execution instance of a workflow. It contains the execution history, status, and any errors that occurred during the run.","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"status":{"default":"running","type":"string","enum":["running","completed","failed","paused"]},"context":{"type":"array","items":{"type":["string","null"]}},"executedNodes":{"type":"array","items":{"type":"string"}},"errorMessage":{"type":["string","null"]},"triggerData":{"type":["string","null"]},"workflowId":{"readOnly":true,"type":["integer","null"]},"workflowName":{"readOnly":true,"type":["string","null"]}}},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["integer","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/workflows/{workflowId}/runs/{id}":{"get":{"operationId":"api_workflows_workflowIdruns_id_get","tags":["Workflow"],"responses":{"200":{"description":"WorkflowRun resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRun-workflow_run.read"}}}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"404":{"description":"Not found","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"Retrieve a workflow run","description":"Retrieve details of a specific workflow run execution by its ID, including execution history and status.","parameters":[{"name":"workflowId","in":"path","description":"Workflow identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false},{"name":"id","in":"path","description":"WorkflowRun identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false}]}}}}
```
