---
title: "POST /ver2/WorkflowService.svc/workflows"
method: POST
path: "/ver2/WorkflowService.svc/workflows"
tags: ["Workflow"]
---

# POST /ver2/WorkflowService.svc/workflows

`POST /ver2/WorkflowService.svc/workflows`

## Request

- Base URL: `https://api.enviance.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.enviance.com/ver2/WorkflowService.svc/workflows`
- Auth: none declared
- TypeScript: <https://skmtc.dev/enviance/apis/restapi/docs/ver2/WorkflowService.svc/workflows/post.ts> (a function with typed inputs; its response is checked against the schema)

envianceSdk.workflows.createWorkflows
```
[
  [
    {
      "workflowTypeName": "workflow Type Name",
      "name": "workflow name 1",
      "uniqueId": "uniqueId - 0000-1-1",
      "parentWorkflowSourceCustomField": {
        "id": null,
        "name": "UDF name"
      },
      "dueDate": "2013-02-07T00:00:00",
      "comment": "my comment",
      "calendars": [
        "My",
        "Object",
        "System"
      ],
      "objects": [
        "/Generation - 1/NE TV"
      ],
      "documents": [
        "Folder1Document1.txt",
        "Folder1Document2.txt"
      ]
    },
    {
      "workflowTypeName": "workflow Type Name",
      "name": "workflow name 2",
      "uniqueId": "uniqueId - 0000-1-2",
      "dueDate": "2013-02-07T00:00:00",
      "comment": "my comment",
      "calendars": [
        "My",
        "Object",
        "System"
      ],
      "objects": [
        "/Generation - 1/NE TV"
      ],
      "documents": [
        "Folder1Document1.txt",
        "Folder1Document2.txt"
      ]
    }
  ],
  "onsuccess",
  "onerror"
]
```
envianceSdk.workflows.createWorkflows21
```
[
  [
    {
      "workflowTypeName": "workflow Type Name",
      "name": "workflow name 1",
      "uniqueId": "uniqueId - 0000-1-1",
      "parentWorkflowSourceCustomField": {
        "id": null,
        "name": "UDF name"
      },
      "dueDate": "2013-02-07T00:00:00",
      "comment": "my comment",
      "calendars": [
        "My",
        "Object",
        "System"
      ],
      "objects": [
        "/Generation - 1/NE TV"
      ],
      "documents": [
        {
          "documentIdOrPath": "Folder1Document1.txt"
        },
        {
          "documentIdOrPath": "Folder1Document2.txt",
          "customFieldIdOrName": "udf-textbox-numeric"
        }
      ]
    },
    {
      "workflowTypeName": "workflow Type Name",
      "name": "workflow name 2",
      "uniqueId": "uniqueId - 0000-1-2",
      "dueDate": "2013-02-07T00:00:00",
      "comment": "my comment",
      "calendars": [
        "My",
        "Object",
        "System"
      ],
      "objects": [
        "/Generation - 1/NE TV"
      ],
      "documents": [
        {
          "documentIdOrPath": "Folder1Document1.txt"
        },
        {
          "documentIdOrPath": "Folder1Document2.txt",
          "customFieldIdOrName": "udf-textbox-numeric"
        }
      ]
    }
  ],
  "onsuccess",
  "onerror"
]
```
envianceSdk.workflows.createWorkflow
```
[
  {
    "workflowTypeName": "workflow Type Name",
    "name": "workflow name 1",
    "uniqueId": "uniqueId - 0000-1-1",
    "parentWorkflowSourceCustomField": {
      "id": null,
      "name": "UDF name"
    },
    "dueDate": "2013-02-07T00:00:00",
    "comment": "my comment",
    "calendars": [
      "My",
      "Object",
      "System"
    ],
    "objects": [
      "/Generation - 1/NE TV"
    ],
    "documents": [
      "Folder1Document1.txt",
      "Folder1Document2.txt"
    ]
  },
  null,
  "onsuccess",
  "onerror"
]
```
envianceSdk.workflows.createWorkflowExt
```
[
  {
    "workflowInfo": {
      "workflowTypeName": "workflow Type Name",
      "name": "workflow name 1",
      "uniqueId": "uniqueId - 0000-1-1",
      "parentWorkflowSourceCustomField": {
        "id": null,
        "name": "UDF name"
      },
      "dueDate": "2013-02-07T00:00:00",
      "comment": "my comment",
      "calendars": [
        "My",
        "Object",
        "System"
      ],
      "objects": [
        "/Generation - 1/NE TV"
      ],
      "documents": [
        "Folder1Document1.txt",
        "Folder1Document2.txt"
      ]
    },
    "initStepInfo": null,
    "clientRequestId": "64AA5290-15F2-451B-9EF3-4494F66FE59F"
  },
  "onsuccess",
  "onerror"
]
```
envianceSdk.workflows.createWorkflow21
```
[
  {
    "workflowTypeName": "workflow Type Name",
    "name": "workflow name 1",
    "uniqueId": "uniqueId - 0000-1-1",
    "parentWorkflowSourceCustomField": {
      "id": null,
      "name": "UDF name"
    },
    "dueDate": "2013-02-07T00:00:00",
    "comment": "my comment",
    "calendars": [
      "My",
      "Object",
      "System"
    ],
    "objects": [
      "/Generation - 1/NE TV"
    ],
    "documents": [
      {
        "documentIdOrPath": "Folder1Document1.txt"
      },
      {
        "documentIdOrPath": "Folder1Document2.txt",
        "customFieldIdOrName": "udf-textbox-numeric"
      }
    ]
  },
  null,
  "onsuccess",
  "onerror"
]
```
envianceSdk.workflows.createWorkflow21Ext
```
[
  {
    "workflowInfo": {
      "workflowTypeName": "workflow Type Name",
      "name": "workflow name 1",
      "uniqueId": "uniqueId - 0000-1-1",
      "parentWorkflowSourceCustomField": {
        "id": null,
        "name": "UDF name"
      },
      "dueDate": "2013-02-07T00:00:00",
      "comment": "my comment",
      "calendars": [
        "My",
        "Object",
        "System"
      ],
      "objects": [
        "/Generation - 1/NE TV"
      ],
      "documents": [
        {
          "documentIdOrPath": "Folder1Document1.txt"
        },
        {
          "documentIdOrPath": "Folder1Document2.txt",
          "customFieldIdOrName": "udf-textbox-numeric"
        }
      ]
    },
    "initStepInfo": null,
    "clientRequestId": "64AA5290-15F2-451B-9EF3-4494F66FE59F"
  },
  "onsuccess",
  "onerror"
]
```
envianceSdk.workflows.createWorkflowType
```
[
  {
    "name": "Workflow Type",
    "workflowSteps": [
      {
        "name": "Step1",
        "status": "Step1",
        "formTemplate": {
          "name": "FT-1"
        },
        "assignedRole": "R-1",
        "stepActions": [
          {
            "name": "Go to Step2",
            "destinationStep": {
              "name": "Step2"
            },
            "allowedRoles": [
              "R-1"
            ]
          },
          {
            "name": "Go to Step3",
            "destinationStep": {
              "name": "Step3"
            },
            "allowedRoles": [
              "R-3"
            ]
          }
        ]
      },
      {
        "name": "Step2",
        "status": "Step2",
        "formTemplate": {
          "name": "FT-2"
        },
        "assignedRole": "R-2",
        "stepActions": [
          {
            "name": "Go to Step3",
            "destinationStep": {
              "name": "Step3"
            },
            "allowedRoles": [
              "R-2"
            ]
          }
        ]
      },
      {
        "name": "Step3",
        "status": "Step3",
        "formTemplate": {
          "name": "FT-3"
        },
        "assignedRole": "R-3",
        "stepActions": [
          {
            "name": "Go to Step1",
            "destinationStep": {
              "name": "Step1"
            },
            "allowedRoles": [
              "R-1",
              "R-2",
              "R-3"
            ]
          }
        ]
      }
    ],
    "localFields": [
      "Calculated Numeric"
    ],
    "workflowPermissions": [
      {
        "role": "R-1",
        "flags": [
          "FullAccess",
          "AllFormFieldAccess"
        ]
      },
      {
        "role": "R-2",
        "flags": [
          "ViewAllFormFields",
          "SetWorkflowID",
          "Close",
          "Reopen",
          "Delete",
          "Rename",
          "Assign",
          "Schedule"
        ]
      },
      {
        "role": "R-3",
        "flags": [
          "OverrideAllFormFields",
          "Open",
          "Report",
          "SetWorkflowID",
          "CompleteUnderlyingTask",
          "ViewUnderlyingTask"
        ]
      }
    ],
    "stepPermissions": [
      {
        "role": "R-1",
        "steps": [
          {
            "step": "Step1",
            "allGlobal": "Edit",
            "allLocal": "View"
          },
          {
            "step": "Step2",
            "allGlobal": "View",
            "allLocal": "Edit"
          },
          {
            "step": "Step3",
            "allGlobal": "Override",
            "allLocal": "Override"
          }
        ]
      }
    ]
  },
  "onsuccess",
  "onerror"
]
```
envianceSdk.workflows.createWorkflowRole
```
[
  {
    "name": "WorkflowRole1",
    "description": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo",
    "defaultMembers": {
      "userIdsOrNames": [
        "user1"
      ],
      "groupIdsOrNames": [
        "group1"
      ]
    }
  },
  "onsuccess",
  "onerror"
]
```
envianceSdk.workflows.createWorkflowRoleAsync
```
[
  {
    "name": "WorkflowRole1",
    "description": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo",
    "defaultMembers": {
      "userIdsOrNames": [
        "user1"
      ],
      "groupIdsOrNames": [
        "group1"
      ]
    }
  },
  "onsuccess",
  "onerror"
]
```

## Headers

- `EnvApi-Systemid` string
- `EnvApi-Packageid` string
- `EnvApi-Udf-DateTime-Iso-In-CustomFields` string
- `EnvApi-Udf-DateTime-ReadInUserTz` string
- `EnvApi-Udf-Value-Invariant` string
- `EnvApi-Localization-All` string
- `x-client-request-id` string

## Request body

- CreateWorkflow
  - `workflowInfo` EnvianceRestServicesVer2WorkflowsWorkflowInfo
    - `id` string, guid
    - `uniqueId` string
    - `name` string
    - `workflowTypeName` string
    - `parentUniqueId` string, guid
    - `parentWorkflowSourceCustomField` EnvianceRestServicesCommonCustomFieldInfo
      - `id` string, guid
      - `name` string
    - `dueDate` string, date-time
    - `status` string
    - `creator` string
    - `created` string, date-time
    - `lastRun` string, date-time
    - `assignedBy` string
    - `assignedTo` EnvianceRestServicesCommonAssigneeV2[]
      - `userIdOrName` string
      - `groupIdOrName` string
    - `objects` string[]
    - `documents` string[]
    - `calendars` string[]
    - `comment` string
    - `closeDate` string, date-time
    - `jsonData` object
  - `initStepInfo` EnvianceRestServicesVer2WorkflowsWorkflowStepInfo
    - `id` string, guid
    - `name` string
    - `comment` string
    - `fields` EnvianceRestServicesUdfsProperty[]
      - `name` string
      - `urlItems` EnvianceBusinessUdfRestUrlItem[]
        - `label` string
        - `url` string
      - `values` string[]
      - `beginDate` string, date-time
      - `endDate` string, date-time
      - `caption` string
      - `captionLocalized` string
    - `transition` EnvianceRestServicesVer2WorkflowsTransition
      - `stepActionName` string
      - `assignTo` EnvianceRestServicesCommonAssigneeV2[]
        - `userIdOrName` string
        - `groupIdOrName` string
      - `dueDate` string, date-time
      - `closeDate` string, date-time
    - `taskCompletion` EnvianceRestServicesVer2TasksTaskOccurrenceInfo[]
      - `statusChangeDate` string, date-time
      - `objectIdOrPath` string
      - `dismissed` boolean
      - `percentComplete` string, byte
      - `hoursToComplete` number, double
      - `costToComplete` number
      - `comment` string
      - `eventInstanceId` string, guid
      - `compliancePeriodStartDate` string, date-time
      - `compliancePeriodEndDate` string, date-time
      - `comply` string
      - `ObjectId` string, guid

## Response `default`

not available

- string, guid

---

[API](https://skmtc.dev/enviance/apis/restapi.md) - [All operations](https://skmtc.dev/enviance/apis/restapi/llms.txt) - [OpenAPI document](https://skmtc.dev/enviance/apis/restapi/revisions/45b2200a8cf2?raw)
