---
title: "Create workflow"
method: POST
path: "/api/v2/workflows"
tags: ["Workflows"]
---

# Create workflow

`POST /api/v2/workflows`

## Request

- Base URL: `https://console.jumpcloud.com`
- URL: `https://console.jumpcloud.com/api/v2/workflows`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/docs/api/v2/workflows/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new workflow

## Request body

- JumpcloudHttpWorkflowsCreateWorkflowRequest: Request body for creating a new workflow
  - `name` string, required: Name of the workflow
  - `description` string: Description of the workflow
  - `dsl` object, required: JSON definition of the workflow DSL
  - `status` 'active' | 'inactive': Status of the workflow
  - `execution_role_id` string, required: Role ID used to identify the workflow execution.

## Response `201`

Workflow created successfully

- JumpcloudHttpWorkflowsWorkflowResponse: Response containing the created workflow
  - `id` string: Unique identifier of the workflow
  - `name` string: Name of the workflow
  - `description` string: Description of the workflow
  - `dsl` object: JSON definition of the workflow DSL
  - `status` string: Status of the workflow
  - `trigger_type` string: Type of the workflow trigger. Possible values: jc_events, external, scheduler.
  - `execution_role_id` string, nullable: Role ID used to identify the workflow execution. Currently optional as part of the rollout. (null/omitted for legacy workflows)
  - `last_ran` string, date-time, nullable: Timestamp when the workflow was last executed
  - `created_by` string: Identifier of the user who created the workflow
  - `created_at` string, date-time: Timestamp when the workflow was created
  - `updated_at` string, date-time: Timestamp when the workflow was last updated

## Other responses

- `400`: Bad request - invalid data
- `401`: Unauthorized - authentication required
- `409`: Conflict - workflow with same name already exists
- `default`: Generic error response

---

[API](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api.md) - [All operations](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/revisions/f396d9271b46?raw)
