# Workflows

## Get all workflows

## GET /api/v1/public/workflows

>

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"TexAu APIs","version":"1.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}}},"paths":{"/api/v1/public/workflows":{"get":{"operationId":"ApiController_getAllWorkflows","parameters":[{"name":"X-TexAu-Context","in":"header","description":"Pass orgUserId and workspaceId as ‘{\"orgUserId\":\"123\",\"workspaceId\":\"123\"}’","required":true,"schema":{"type":"string"}},{"name":"start","required":false,"in":"query","description":"The page No","schema":{"minimum":0,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"The Page Size","schema":{"minimum":1,"maximum":50,"type":"number"}}],"responses":{"200":{"description":"Workflows fetched successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"total":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["success","message","total","data"]}}}},"401":{"description":"Unauthorized access"},"403":{"description":"Your plan does not have API access"},"422":{"description":"Requested workspace does not belongs to you"},"500":{"description":"Error in fetching workflows"}},"tags":["API Service"]}}}}
```

## Get workflow by ID

{% hint style="info" %}
Get `workflowId` from the response of the above API.
{% endhint %}

## GET /api/v1/public/workflows/{id}

>

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"TexAu APIs","version":"1.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}}},"paths":{"/api/v1/public/workflows/{id}":{"get":{"operationId":"ApiController_getWorkflowById","parameters":[{"name":"X-TexAu-Context","in":"header","description":"Pass orgUserId and workspaceId as ‘{\"orgUserId\":\"123\",\"workspaceId\":\"123\"}’","required":true,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Workflow fetched successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"isScheduled":{"type":"boolean"},"inputSource":{"type":"string"}},"required":["id","name","description","isScheduled","inputSource"]}},"required":["success","message","data"]}}}},"401":{"description":"Unauthorized access"},"403":{"description":"Your plan does not have API access"},"404":{"description":"Workflow not found"},"422":{"description":"Requested workspace does not belongs to you"},"500":{"description":"Error in fetching workflow"}},"tags":["API Service"]}}}}
```

## Pause Workflow

This API will pause the workflow, which means all scheduled executions will be canceled.

{% hint style="info" %}
Get `workflowId` from the response of the above API.
{% endhint %}

## POST /api/v1/public/workflows/{workflowId}/pause

>

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"TexAu APIs","version":"1.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}}},"paths":{"/api/v1/public/workflows/{workflowId}/pause":{"post":{"operationId":"ApiController_pauseWorkflow","parameters":[{"name":"X-TexAu-Context","in":"header","description":"Pass orgUserId and workspaceId as ‘{\"orgUserId\":\"123\",\"workspaceId\":\"123\"}’","required":true,"schema":{"type":"string"}},{"name":"workflowId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Workflow paused successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"data":{"type":"object","properties":{"workflowId":{"type":"string"},"isActive":{"type":"boolean"},"isInternalSchedule":{"type":"boolean"},"isScheduled":{"type":"boolean"},"isJobAddedOnQueue":{"type":"boolean"}},"required":["workflowId","isActive","isInternalSchedule","isScheduled","isJobAddedOnQueue"]}},"required":["success","message","data"]}}}},"401":{"description":"Unauthorized access"},"403":{"description":"Your plan does not have API access"},"404":{"description":"Workflow not found"},"422":{"description":"Requested workspace does not belongs to you"}},"tags":["API Service"]}}}}
```

## Get workflow nodes by workflow ID

This API will give you a list of all nodes in the workflow.

{% hint style="info" %}
Get `workflowId` from the response of the above API.
{% endhint %}

## GET /api/v1/public/workflows/{workflowId}/nodes

>

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"TexAu APIs","version":"1.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}}},"paths":{"/api/v1/public/workflows/{workflowId}/nodes":{"get":{"operationId":"ApiController_getAllNodes","parameters":[{"name":"X-TexAu-Context","in":"header","description":"Pass orgUserId and workspaceId as ‘{\"orgUserId\":\"123\",\"workspaceId\":\"123\"}’","required":true,"schema":{"type":"string"}},{"name":"workflowId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Workflow nodes fetched successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"total":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"nextNode":{"type":"string"},"previousNode":{"type":"string"},"connectedAccountId":{"type":"string"},"inputs":{"type":"object"}},"required":["id","label","nextNode","previousNode","connectedAccountId","inputs"]}}},"required":["success","message","total","data"]}}}},"401":{"description":"Unauthorized access"},"403":{"description":"Your plan does not have API access"},"404":{"description":"Workflow not found"},"422":{"description":"Requested workspace does not belongs to you"},"500":{"description":"Error in fetching workflow nodes"}},"tags":["API Service"]}}}}
```
