# Create Workflow

Create an empty workflow. It starts disabled: add its triggers and steps with Add Workflow Trigger and Add Workflow Step (or in the app), publish it, then enable it with Update a Workflow.

`POST https://connect.mindcloud.co/v2/workflows`

Permissions: `workflow:create`.

## Parameters

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. A key can also act in its child organizations, and, with "Use this key across all of your organizations" on, in every organization its creator can open in the app. List them with GET /v2/companies. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

### Body

- `name` (string, required): The name your team will see in the app.
- `tags` (array): Tag ids to put on the workflow, from the workflow tag catalog.
  Default: `[]`
- `type` (string): workflow, or function for one other workflows call.
  workflow (the default), or function: a workflow other workflows call with Run Workflow.
  Default: `workflow`
  Allowed values:
    - `workflow`
    - `function`

## Example request

```bash
curl --request POST \
  --url 'https://connect.mindcloud.co/v2/workflows' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Order sync",
  "tags": [
    "Tg2mV7xQ4kNs"
  ],
  "type": "workflow"
}'
```

## Response fields

- `id` (string): Unique id of the workflow.
- `name` (string): The name your team gave the workflow.
- `type` (string): The workflow's type.
- `isActive` (boolean): True while the workflow is enabled and able to run.
- `isTemplate` (boolean): True if this is a template rather than a live workflow.
- `size` (string): The workflow's runner size: xs, sm, md, lg, xl, or xxl. Empty when sized automatically.
- `tags` (array of string): Ids of the tags on the workflow. The tag catalog is managed in the app.
- `createdOn` (date): When the workflow was created.
- `createdBy` (string): Who created it.
- `updatedOn` (date): When it was last changed.
- `updatedBy` (string): Who last changed it.
