Workflows

Perform an action on a workflow template

Performs an action on an existing workflow template. The only supported action is copy.

copy creates a new template in the caller's company from the source template and returns it. The copy is not an exact duplicate:

  • the name is derived from the source as {sourceName}-{suffix}-copy, where {suffix} is generated until the name is free within the company;
  • status is always UNPUBLISHED, regardless of the source status;
  • isDefault is always false, so a copy of a platform template becomes an ordinary template owned by the caller's company;
  • resource parameters, content, content parameters and tags are copied; tag keys that do not yet exist in the caller's company are created;
  • values of non-secret content parameters are copied; values of secret parameters are not copied — such parameters arrive with hasDefaultValue = false and must be re-entered by the owner before the workflow can be executed;
  • when workflow versioning is enabled, the copy starts its own history with a single active version v1; the source's version history is not copied.
post/v1/workflow-templates/{id}/actions

Request

  • Base URL
    https://api.emma.ms/external
  • Auth
    HTTP bearer

Path parameters

idinteger required

ID of the workflow template

Request body

action'copy' required

Action to perform on the workflow template. Currently only copy is supported (creates a duplicate of the template). Accepted case-insensitively; serialized in lowercase.

Example request

{
  "action": "copy"
}

Response

Workflow template created successfully

idinteger required

ID of the workflow template

namestring required

Name of the workflow template

descriptionstring nullable

Description of the workflow template

createdAtstring required

Date and time of the workflow template creation (ISO-8601, UTC, with milliseconds)

createdByNamestring required

Name of the user who created the workflow template

createdByIdinteger required

ID of the user who created the workflow template

modifiedAtstring required

Date and time when the workflow template was last edited (ISO-8601, UTC, with milliseconds)

modifiedByNamestring required

Name of the user who last edited the workflow template

modifiedByIdinteger required

ID of the user who last edited the workflow template

isDeletedboolean required

Indicates whether the workflow template is deleted

status'PUBLISHED' | 'UNPUBLISHED' required

Status of the workflow template. Can be PUBLISHED or UNPUBLISHED

resourceTypesstring[] required

Types of the resource.

resourceType'COMPUTE' | 'SPOT_COMPUTE' nullable

Deprecated — use resourceTypes. Mirrors the first resource type; present for backward compatibility. Null when no resource type is set.

activeVersionIdinteger nullable

ID of the active workflow version. null when the template has no versions — permanently so for built-in default templates (isDefault = true), which are excluded from versioning, and until the one-off backfill covers templates created before versioning was enabled.

activeVersionNamestring nullable

Name of the active workflow version. null under the same conditions as activeVersionId.

contentType'Shell' required

Format of the content field, only Shell is supported for now

contentstring required

Content of the workflow template. For Shell contentType, it includes shell commands to execute.

isContentValidboolean required

Indicates whether the content of the workflow template is valid. The content is validated against the contentType, e.g. for Shell contentType, the content is validated to be correct shell commands.

contentExecutionTimeoutinteger required

Maximum script execution time in minutes (1–30). Defaults to 10 when omitted on create/update.

isDefaultboolean required

Indicates whether this is a built-in default (system-provided) workflow template.

Example response

{
  "id": 123,
  "name": "Sample Workflow Template",
  "description": "This is a sample workflow template for demonstration purposes.",
  "createdAt": "2026-06-26T21:44:05.345Z",
  "createdByName": "Automation User",
  "createdById": 123,
  "modifiedAt": "2026-07-07T07:38:16.285Z",
  "modifiedByName": "Automation User",
  "modifiedById": 123,
  "status": "PUBLISHED",
  "resourceTypes": [
    "COMPUTE"
  ],
  "resourceType": "COMPUTE",
  "activeVersionId": 123,
  "activeVersionName": "v1",
  "resourceParams": [
    {
      "name": "minCpuCores",
      "value": "4"
    }
  ],
  "tags": [
    {
      "key": "env",
      "value": "dev"
    }
  ],
  "contentType": "Shell",
  "content": "echo Hello, World!",
  "isContentValid": true,
  "contentParams": [
    {
      "name": "command1",
      "defaultValue": "echo Hello, World!",
      "mandatory": true,
      "description": "Database password used by the deployment script.",
      "hasDefaultValue": true,
      "vaultVersion": 1
    }
  ],
  "contentExecutionTimeout": 10
}

Changes

No recorded changes to this operation across all 1 revision of this API.