Workflows

Perform actions with a workflow version

Executes "Restore" action on the specified workflow version.

Restoring creates a new active version from the selected version's snapshot. The new version receives an auto-generated name; use PATCH to assign a custom name.

A workflow template can contain up to 20 versions. If the limit is reached, retry the request with forceDeleteOldest = true to delete the oldest non-active version as part of the same operation. The restore is rejected if the oldest non-active version is the one being restored.

post/v1/workflow-templates/{id}/versions/{versionId}/actions

Request

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

Path parameters

idinteger required

ID of the workflow template

versionIdinteger required

ID of the workflow template version

Request body

action'restore' required

restore — creates a new active version from this version's snapshot. The new version gets a server-generated name and is not a byte-for-byte duplicate: secret parameters come back with hasDefaultValue = false (secret values are never restored) and Vault-backed parameters get a fresh vaultVersion. The previous active version remains in history with isActive = false.

forceDeleteOldestboolean nullable

Indicates whether the oldest version may be deleted if the 20-version limit is reached. By default - false

Example request

{
  "action": "restore"
}

Response

Workflow version restored successfully

idinteger required

ID of the workflow template version

namestring required

Name of the workflow version

createdAtstring required

Date and time of the version creation.

createdByIdinteger required

ID of the user or service application that initiated creation of the version.

createdByNamestring required

Name of the user or service application that initiated creation of the version.

isActiveboolean required

Indicates whether the workflow version is active

secretsChangedboolean required

Indicates whether the secrets were changed in this version.

tagsRestorableboolean nullable

Indicates whether all tags in the snapshot can be restored. true if every tag still exists in the company, false if at least one has been deleted and cannot be restored.

null when restorability was not determined — the snapshot holds no tags at all, or the check could not be completed. Treat null as "unknown", not as false.

sequenceNumberinteger required

A sequential number assigned to each version in creation order.

restoredFrominteger nullable

ID of the source version. Present only if this version was created by restoring another version; null otherwise.

restoredFromNamestring nullable

Name of the source version. Present only if this version was created by restoring another version; null otherwise.

Example response

{
  "id": 123,
  "name": "v1",
  "createdAt": "2026-11-26T14:54:11",
  "createdById": 543,
  "createdByName": "Automation User",
  "tagsRestorable": true,
  "sequenceNumber": 7,
  "restoredFrom": 123,
  "restoredFromName": "v11",
  "snapshot": {
    "name": "Deploy MongoDB",
    "description": "Deploy MongoDB from a shell script.",
    "status": "PUBLISHED",
    "resourceTypes": [
      "COMPUTE"
    ],
    "resourceParams": [
      {
        "name": "minCpuCores",
        "value": "4"
      }
    ],
    "tags": [
      {
        "tagId": "123",
        "key": "environment",
        "value": "production"
      }
    ],
    "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.