Assign Workflow to Service

The Assign Workflow to Service API endpoint enables administrators to link a specific workflow to a service within their organisation. By defining details such as the workflow and service identifiers, this endpoint ensures seamless integration tailored to operational needs. leveraging this feature enhances task coordination, improves service performance, and fosters consistency across teams. It simplifies the management of workflows and services, making it a vital tool for organisations aiming to optimise their processes and ensure alignment with business goals.

Syntax: see 'CCall Structure

Type = 'POST'

'https://connect.cambrionix.com/api/workflows/v1/workflows/workflow-id/service'

Output Description
workflow-id This is the id of the workflow as a unique 128-bit number

In the data section of the request, include the workflow information you wish to add, formatted as shown below.

{ "serviceId": workflow-service-id }

Output Description
workflow-service-id This is the id of the workflow service as a unique 128-bit number
Returns:

{ "result": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "organization": { "id": "organisation-id", "name": "organisation-name" }, "service": { "id": "workflow-service-id", "type": "service-type" }, "workflow": { "created": { "time": time, "user": { "id": "user-id", "detail": { "givenName": "given-name", "surname": "surname", "displayName": "display-name", "email": "account-email" } } }, "updated": { "time": time, "user": { "id": "user-id", "detail": { "givenName": "given-name", "surname": "surname", "displayName": "display-name", "email": "account-email" } } }, "ttl": time, "id": "workflow-id", "name": "workflow-name", "description": "workflow-description", "events": "string", "connections": [ { "id": "unique-connection-id", "type": "connection-type", "from": { "id": "unique-event-id" }, "to": { "id": "unique-event-id" } } ], "enabled": option-status, "published": option-status, "organization": { "id": "organisation-id", "name": "organisation-name" } }, "downloaded": { "time": time } } } } }

Output Description
time The hub time, shown as an integer in ms
user-id This is the id of the user as a unique 128-bit number
given-name The first name of the user
surname The surname of the user
display-name The account name of the user
account-email The email of the user
workflow-id This is the id of the workflow as a unique 128-bit number
workflow-name This is the name of the workflow
workflow-description This is a description of the workflow
unique-connection-id This is the id of a unique connection as a unique 128-bit number
connection-type This is the type of connection e.g. success
unique-event-id This is the id of a unique event as a unique 128-bit number
option-status The status of the option (true/false)
organisation-id This is the id of the organisation as a unique 128-bit number
organisation-name This is the name of the organisation
Example
curl -X 'POST' \
  'https://connect.cambrionix.com/api/workflows/v1/workflows/00000000-0000-0000-0000-000000000001/service' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJSUziNDJiLTk3YWIyZmUxMjQ2MCTg' \
  -H 'Content-Type: application/json' \
  -d '{
  "serviceId": "00000000-0000-0000-0000-000000000002"
}'
Returns
Copy
{
  "result": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "organization": {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name": "string"
    },
    "service": {
      "id": "string",
      "type": "workflow"
    },
    "workflow": {
      "created": {
        "time": 0,
        "user": {
          "id": "string",
          "detail": {
            "givenName": "string",
            "surname": "string",
            "displayName": "string",
            "email": "string"
          }
        }
      },
      "updated": {
        "time": 0,
        "user": {
          "id": "string",
          "detail": {
            "givenName": "string",
            "surname": "string",
            "displayName": "string",
            "email": "string"
          }
        }
      },
      "ttl": 0,
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name": "string",
      "description": "string",
      "events": "string",
      "connections": [
        {
          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "type": "success",
          "from": {
            "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
          },
          "to": {
            "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
          }
        }
      ],
      "enabled": true,
      "published": true,
      "organization": {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "name": "string"
      }
    },
    "downloaded": {
      "time": 0
    }
  }
}
Errors

If there is an error in the API method then JSON-RPC Error Object a will be returned