---
title: "Add workflow"
method: POST
path: "/workflow_builder/workflows/save"
tags: ["Workflow Builder"]
---

# Add workflow

`POST /workflow_builder/workflows/save`

## Request

- Base URL: `https://example.itential.io`
- URL: `https://example.itential.io/workflow_builder/workflows/save`
- Auth: none declared

Adds a Workflow to the database.

## Request body

- object
  - `workflow` WorkflowBuilderWorkflowDocument: Third generation workflow document as it exists in the database
    - `scenarios` WorkflowBuilderWorkflowDocumentScenariosItems[]
      - `name` string, required
      - `description` string
      - `input` WorkflowBuilderWorkflowDocumentScenariosItemsInput, required
      - `taskMocks` WorkflowBuilderWorkflowDocumentScenariosItemsTaskMocks
      - `last_updated` string, date-time
      - `last_updated_by` union
        - WorkflowBuilderWorkflowDocumentScenariosItemsLastUpdatedBy0
          - `username` string, required
          - `provenance` string, required
        - string
    - `_id` string
    - `uuid` string
    - `name` string, required
    - `type` string, required
    - `description` string, nullable
    - `namespace` WorkflowBuilderWorkflowDocumentNamespace
      - `type` unknown
      - `_id` string
      - `name` string
      - `accessControl` WorkflowBuilderWorkflowDocumentNamespaceAccessControl
        - `read` string[]
        - `execute` string[]
        - `write` string[]
        - `manage` string[]
    - `preAutomationTime` integer: Time (milliseconds) automation would have taken someone to complete without using IAP.
    - `sla` integer
    - `tasks` WorkflowBuilderWorkflowDocumentTasks, required
      - `workflow_start` WorkflowBuilderWorkflowDocumentTasksWorkflowStart, required
        - `name` string
        - `summary` string
        - `groups` string[]
        - `nodeLocation` WorkflowBuilderWorkflowDocumentTasksWorkflowStartNodeLocation: Stores the coordinates used by canvasVersion: 3 workflows
          - `x` number, double, required
          - `y` number, double, required
        - `x` number, double
        - `y` number, double
      - `workflow_end` WorkflowBuilderWorkflowDocumentTasksWorkflowEnd, required
        - `name` string
        - `summary` string
        - `groups` string[]
        - `nodeLocation` WorkflowBuilderWorkflowDocumentTasksWorkflowEndNodeLocation: Stores the coordinates used by canvasVersion: 3 workflows
          - `x` number, double, required
          - `y` number, double, required
        - `x` number, double
        - `y` number, double
      - `error_handler` WorkflowBuilderWorkflowDocumentTasksErrorHandler: Deprecated gen2-specific feature
        - `nodeLocation` WorkflowBuilderWorkflowDocumentTasksErrorHandlerNodeLocation: Stores the coordinates used by canvasVersion: 3 workflows
          - `x` number, double, required
          - `y` number, double, required
        - `x` number, double
        - `y` number, double
        - `name` 'childJob', required
        - `summary` string, required
        - `description` string, required
        - `app` string, required
        - `variables` WorkflowBuilderWorkflowDocumentTasksErrorHandlerVariables, required
          - `incoming` WorkflowBuilderWorkflowDocumentTasksErrorHandlerVariablesIncoming, required
          - `outgoing` WorkflowBuilderWorkflowDocumentTasksErrorHandlerVariablesOutgoing, required
          - `error` string
          - `decorators` WorkflowBuilderWorkflowDocumentTasksErrorHandlerVariablesDecoratorsItems[]
            - `type` 'encryption'
            - `pointer` string, json-pointer
        - `deprecated` boolean
        - `scheduled` boolean
        - `groups` string[], required
        - `type` 'operation', required
        - `retrySettings` WorkflowBuilderWorkflowDocumentTasksErrorHandlerRetrySettings: Retry settings for a task.
          - `state` WorkflowBuilderWorkflowDocumentTasksErrorHandlerRetrySettingsStateItems[], required: Finish states the task will retry on. The task will retry on any of the included states.
          - `autoRetry` boolean, required: Whether the task is set to retry automatically or manually.
          - `limit` integer, required: Limit of retries on a task before it will take normal transitions and stop retrying.
          - `delay` integer, required: Delay between each retry in milliseconds.
          - `count` integer: Current retry count used for workflow engine job processing
    - `transitions` WorkflowBuilderWorkflowDocumentTransitions, required
      - `workflow_start` WorkflowBuilderWorkflowDocumentTransitionsWorkflowStart, required
      - `workflow_end` WorkflowBuilderWorkflowDocumentTransitionsWorkflowEnd, required
      - `error_handler` WorkflowBuilderWorkflowDocumentTransitionsErrorHandler
    - `errorHandler` WorkflowBuilderWorkflowDocumentErrorHandler: Deprecated gen2-specific feature
      - `type` string
      - `name` string
    - `font_size` integer: Deprecated, unused, gen1-specific feature
    - `groups` string[], required
    - `created` string, date-time
    - `created_by` union
      - WorkflowBuilderWorkflowDocumentCreatedBy0
        - `username` string, required
        - `provenance` string, required
      - string
    - `createdVersion` string
    - `last_updated` string, date-time
    - `last_updated_by` union
      - WorkflowBuilderWorkflowDocumentLastUpdatedBy0
        - `username` string, required
        - `provenance` string, required
      - string
    - `lastUpdatedVersion` string: This value represents the semantic version of the application that last modified it. For workflows with canvasVersion = 1, this field will refer to the version of Workflow Builder. For workflows with canvasVersion > 1, this field will refer to the version of Studio.
    - `tags` string[]
    - `canvasVersion` number, double
    - `encodingVersion` '1'
    - `inputSchema` WorkflowBuilderWorkflowDocumentInputSchema
    - `outputSchema` WorkflowBuilderWorkflowDocumentOutputSchema
    - `outputData` object: Deprecated gen2-specific feature
    - `decorators` WorkflowBuilderWorkflowDocumentDecoratorsItems[]
      - `type` 'encryption'
      - `pointer` string, json-pointer
    - `migrationVersion` integer

## Response `200`

The new Workflow with its data and ID.

- WorkflowBuilderWorkflowDocument: Third generation workflow document as it exists in the database
  - `scenarios` WorkflowBuilderWorkflowDocumentScenariosItems[]
    - `name` string, required
    - `description` string
    - `input` WorkflowBuilderWorkflowDocumentScenariosItemsInput, required
    - `taskMocks` WorkflowBuilderWorkflowDocumentScenariosItemsTaskMocks
    - `last_updated` string, date-time
    - `last_updated_by` union
      - WorkflowBuilderWorkflowDocumentScenariosItemsLastUpdatedBy0
        - `username` string, required
        - `provenance` string, required
      - string
  - `_id` string
  - `uuid` string
  - `name` string, required
  - `type` string, required
  - `description` string, nullable
  - `namespace` WorkflowBuilderWorkflowDocumentNamespace
    - `type` unknown
    - `_id` string
    - `name` string
    - `accessControl` WorkflowBuilderWorkflowDocumentNamespaceAccessControl
      - `read` string[]
      - `execute` string[]
      - `write` string[]
      - `manage` string[]
  - `preAutomationTime` integer: Time (milliseconds) automation would have taken someone to complete without using IAP.
  - `sla` integer
  - `tasks` WorkflowBuilderWorkflowDocumentTasks, required
    - `workflow_start` WorkflowBuilderWorkflowDocumentTasksWorkflowStart, required
      - `name` string
      - `summary` string
      - `groups` string[]
      - `nodeLocation` WorkflowBuilderWorkflowDocumentTasksWorkflowStartNodeLocation: Stores the coordinates used by canvasVersion: 3 workflows
        - `x` number, double, required
        - `y` number, double, required
      - `x` number, double
      - `y` number, double
    - `workflow_end` WorkflowBuilderWorkflowDocumentTasksWorkflowEnd, required
      - `name` string
      - `summary` string
      - `groups` string[]
      - `nodeLocation` WorkflowBuilderWorkflowDocumentTasksWorkflowEndNodeLocation: Stores the coordinates used by canvasVersion: 3 workflows
        - `x` number, double, required
        - `y` number, double, required
      - `x` number, double
      - `y` number, double
    - `error_handler` WorkflowBuilderWorkflowDocumentTasksErrorHandler: Deprecated gen2-specific feature
      - `nodeLocation` WorkflowBuilderWorkflowDocumentTasksErrorHandlerNodeLocation: Stores the coordinates used by canvasVersion: 3 workflows
        - `x` number, double, required
        - `y` number, double, required
      - `x` number, double
      - `y` number, double
      - `name` 'childJob', required
      - `summary` string, required
      - `description` string, required
      - `app` string, required
      - `variables` WorkflowBuilderWorkflowDocumentTasksErrorHandlerVariables, required
        - `incoming` WorkflowBuilderWorkflowDocumentTasksErrorHandlerVariablesIncoming, required
        - `outgoing` WorkflowBuilderWorkflowDocumentTasksErrorHandlerVariablesOutgoing, required
        - `error` string
        - `decorators` WorkflowBuilderWorkflowDocumentTasksErrorHandlerVariablesDecoratorsItems[]
          - `type` 'encryption'
          - `pointer` string, json-pointer
      - `deprecated` boolean
      - `scheduled` boolean
      - `groups` string[], required
      - `type` 'operation', required
      - `retrySettings` WorkflowBuilderWorkflowDocumentTasksErrorHandlerRetrySettings: Retry settings for a task.
        - `state` WorkflowBuilderWorkflowDocumentTasksErrorHandlerRetrySettingsStateItems[], required: Finish states the task will retry on. The task will retry on any of the included states.
        - `autoRetry` boolean, required: Whether the task is set to retry automatically or manually.
        - `limit` integer, required: Limit of retries on a task before it will take normal transitions and stop retrying.
        - `delay` integer, required: Delay between each retry in milliseconds.
        - `count` integer: Current retry count used for workflow engine job processing
  - `transitions` WorkflowBuilderWorkflowDocumentTransitions, required
    - `workflow_start` WorkflowBuilderWorkflowDocumentTransitionsWorkflowStart, required
    - `workflow_end` WorkflowBuilderWorkflowDocumentTransitionsWorkflowEnd, required
    - `error_handler` WorkflowBuilderWorkflowDocumentTransitionsErrorHandler
  - `errorHandler` WorkflowBuilderWorkflowDocumentErrorHandler: Deprecated gen2-specific feature
    - `type` string
    - `name` string
  - `font_size` integer: Deprecated, unused, gen1-specific feature
  - `groups` string[], required
  - `created` string, date-time
  - `created_by` union
    - WorkflowBuilderWorkflowDocumentCreatedBy0
      - `username` string, required
      - `provenance` string, required
    - string
  - `createdVersion` string
  - `last_updated` string, date-time
  - `last_updated_by` union
    - WorkflowBuilderWorkflowDocumentLastUpdatedBy0
      - `username` string, required
      - `provenance` string, required
    - string
  - `lastUpdatedVersion` string: This value represents the semantic version of the application that last modified it. For workflows with canvasVersion = 1, this field will refer to the version of Workflow Builder. For workflows with canvasVersion > 1, this field will refer to the version of Studio.
  - `tags` string[]
  - `canvasVersion` number, double
  - `encodingVersion` '1'
  - `inputSchema` WorkflowBuilderWorkflowDocumentInputSchema
  - `outputSchema` WorkflowBuilderWorkflowDocumentOutputSchema
  - `outputData` object: Deprecated gen2-specific feature
  - `decorators` WorkflowBuilderWorkflowDocumentDecoratorsItems[]
    - `type` 'encryption'
    - `pointer` string, json-pointer
  - `migrationVersion` integer

## Other responses

- `500`: Error response from API

## Changes

- **2026-10-31** `2095cc90e583`: 2 info
  - api tag `Workflow Builder` added
  - api tag `workflowBuilder` removed

[Operation history](https://skmtc.dev/itential/apis/itential-2/changes/workflow_builder/workflows/save/post.md)

---

[API](https://skmtc.dev/itential/apis/itential-2.md) - [All operations](https://skmtc.dev/itential/apis/itential-2/llms.txt) - [OpenAPI document](https://skmtc.dev/itential/apis/itential-2/revisions/2095cc90e583?raw)
