GraphQL API

Overview

As of version 7.0.0, WorkflowGen features the new GraphQL API, which is a modern solution to create process-driven solutions such as mobile apps, web apps, and microservices that require a powerful workflow and BPM engine.
The WorkflowGen GraphQL API is a Node.js application that runs in IIS using iisnode. It enables a high level of customization such as extending the GraphQL schema with custom types, queries or operations, or implementing new authentication methods.

About GraphQL

From the GraphQL website presentation:
"GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools."
GraphQL is a production-ready and an open source technology created by Facebook. In September 2016, GitHub announced its GraphQL API.
"We’ve often heard that our REST API was an inspiration for other companies; countless tutorials refer to our endpoints. Today, we’re excited to announce our biggest change to the API since we snubbed XML in favor of JSON: we’re making the GitHub API available through GraphQL."
GraphQL is a modern API solution for React, React-Native, Angular 2, and Vue based applications.
Many GraphQL tutorials are available, it is available in many languages, and has a large community.

Technical requirements

In addition to the standard WorkflowGen installation, the following components are required:
For information on the installation procedure, see the WorkflowGen Technical Guide.

Endpoints

The following endpoints are available:
  • GraphQL API: http://localhost/wfgen/graphql
  • GraphiQL IDE: http://localhost/wfgen/graphql
  • GraphQL Schema (definition language): http://localhost/wfgen/graphql/schema
The HTTP GET method is supported on queries only. The HTTP POST method is supported on queries and operations.

HTTP usage

Express-graphql is used to serve the GraphQL HTTP queries:
GraphQL will first look for each parameter in the URL's query-string: /graphql?query=query+getUser($id:ID){user(id:$id){name}}&variables={"id":"4"} If not found in the query-string, it will look in the POST request body. If the POST body has not yet been parsed, express-graphql will interpret it depending on the provided Content-Type header:
  • application/json: the POST body will be parsed as a JSON object of parameters.
  • application/x-www-form-urlencoded: this POST body will be parsed as a url-encoded string of key-value pairs.
  • application/graphql: the POST body will be parsed as GraphQL query string, which provides the query parameter.

Using GraphiQL IDE in a web browser

You can use GraphiQL, "a graphical interactive in-browser GraphQL IDE", to test queries and operations, and to browse the schema documentation.
As of WorkflowGen version 7.15.0, the GraphiQL tool is disabled by default. You can enable it in the GraphQL section on the Integration tab in the Configuration Panel. You can also enable GraphiQL in the WorkflowGen web.config file by setting the GraphqlGraphiqlEnabled parameter to Y.

Configuration

Maximum query content length

The maximum GraphQL query content length can be set by configuring the maxAllowedContentLength property in the WorkflowGen web.config file. The following example shows how to configure this property as 1 MB (note that the value should always be specified in bytes, so the value in the example is 1,024,000 bytes). The default value is 30000000 bytes.
1
<system.webServer>
2
<security>
3
<requestFiltering>
4
<requestLimits maxAllowedContentLength="1024000" />
5
</requestFiltering>
6
</security>
7
</system.webServer>
Copied!

Input file allowed folders

You can configure the local or remote folder paths where files used by FILE type parameters are located using the Input file allowed folders setting In the GraphQL section on the Configuration Panel Integration tab. (Alternately, you can add the folder names separated by commas to the GraphqlInputFileAllowedFolders parameter in the WorkflowGen web.config file.)
When using file uploads, you don't need to include the original file folder.
To disallow input file allowed folders, leave this field empty. To allow certain folders only, enter comma-separated values according to the table below:
Value
Description
Empty
No folders allowed
*
All folders allowed
c:\*
All folders on drive c:
c:\Inetpub\*
All subfolders in a specific folder
c:\Inetpub\folder*
All c:\Inetpub folders whose names start with folder 📌 Examples:
  • c:\Inetpub\folder1
  • c:\Inetpub\folder1\abc
  • c:\Inetpub\folder2
c:\Inetpub\folder2\abc\def
Specific folder only

Input file allowed HTTP URLs

You can configure allowed HTTP URLs for input files using the Input file allowed HTTP URLs setting in the GraphQL section on the Configuration Panel Integration tab.
To disallow file uploads using HTTP and/or HTTPS URLs, leave the field empty. To allow certain URLs only, enter comma-separated values according to the table below:
Value
Description
Empty
No HTTP or HTTPS URLs allowed
*
All HTTP and HTTPS URLs allowed
https://*
HTTPS URLs only
http://*
HTTP URLs only
http://mydomain/*
HTTP from a specific domain only
http://mydomain/folder/*
HTTP from a specific folder only
http://mydomain/folder*
All files and folders whose names start with folder 📌 Examples:
  • http://mydomain/folderfile.jpg
  • http://mydomain/folder/file.jpg
  • http://mydomain/folder2/file.jpg
http://mydomain/folder/file.jpg
Specific file only

Maximum input file size

In the GraphQL section on the Integration tab in the Administration Module Configuration Panel, enter the maximum input file size in kilobytes in the Maximum input file size (kB) field.
Alternately, you can set the maximum input file content size in kilobytes as the value of the GraphqlMaxInputFileSize parameter in the WorkflowGen web.config file.

Maximum input file content size

When working with FILE type parameters content encoded in base64, you must enter the maximum input file content size in kilobytes in the Maximum input file content size (kB) field in the GraphQL section on the Integration tab in the Administration Module Configuration Panel.
Alternately, you can set the maximum input file content size in kilobytes as the value of the GraphqlMaxInputFileContentSize parameter in the WorkflowGen web.config file.
FILE type data content is only recommended for small files under 1 MB.

Performance tuning

WorkflowGen is installed with the following default GraphQL settings (located under iisnode in \wfgen\graphql\web.config):
1
nodeProcessCountPerApplication="0"
2
maxConcurrentRequestsPerProcess="1024"
Copied!
The value of the nodeProcessCountPerApplication setting is set to 0 by default for the best performance in Node.js applications. This creates one node process based on the number of virtual processors that are configured. You can change this value at any time to a custom number of node processes; for example, nodeProcessCountPerApplication=2 will create two node processes independently of the number of virtual processors.
You can also optimize performance if needed by adjusting the maxConcurrentRequestsPerProcess value based on the number of potential concurrent users and requests.

Cross-origin resource sharing (CORS)

In order to allow a client application (such as front-end JavaScript code from an outside domain) to access and request data from the API, you must enable and configure the Cross-origin resource sharing (CORS) settings in the WorkflowGen GraphQL API module. To do this:
  1. 1.
    Install the IIS CORS Module on the WorkflowGen web server.
  2. 2.
    Add the cors node with the list of external domains and their methods and headers (where HTTP requests will be allowed) to the WorkflowGen web configuration settings (located in \wfgen\web.config). See some common examples below.
📌 Example 1: Allow all origins
1
<configuration>
2
<location path="graphql" inheritInChildApplications="false">
3
<system.webServer>
4
<cors enabled="true">
5
<add origin="*">
6
<allowMethods>
7
<add method="GET" />
8
<add method="POST" />
9
<add method="OPTIONS" />
10
<add method="HEAD" />
11
</allowMethods>
12
<allowHeaders>
13
<add header="Accept" />
14
<add header="Origin" />
15
<add header="Authorization" />
16
<add header="Content-Type" />
17
</allowHeaders>
18
</add>
19
</cors>
20
</system.webServer>
21
</location>
22
</configuration>
Copied!
📌 Example 2: Allow specific origins
1
<configuration>
2
<location path="graphql" inheritInChildApplications="false">
3
<system.webServer>
4
<cors enabled="true">
5
<add origin="https://domain.b.com" allowCredentials="true">
6
<allowMethods>
7
<add method="GET" />
8
<add method="POST" />
9
<add method="OPTIONS" />
10
<add method="HEAD" />
11
</allowMethods>
12
<allowHeaders>
13
<add header="Accept" />
14
<add header="Origin" />
15
<add header="Authorization" />
16
<add header="Content-Type" />
17
</allowHeaders>
18
</add>
19
<add origin="https://domain.c.com" allowCredentials="true">
20
<allowMethods>
21
<add method="GET" />
22
<add method="POST" />
23
<add method="OPTIONS" />
24
<add method="HEAD" />
25
</allowMethods>
26
<allowHeaders>
27
<add header="Accept" />
28
<add header="Origin" />
29
<add header="Authorization" />
30
<add header="Content-Type" />
31
</allowHeaders>
32
</add>
33
</cors>
34
</system.webServer>
35
</location>
36
</configuration>
Copied!
For more information about the CORS configuration, see the IIS CORS module Configuration Reference.

Authentication

The following authentication methods are supported:
  • IIS Basic
  • WorkflowGen authentication
  • Custom .NET authentication modules
  • OpenID Connect
If your WorkflowGen site is configured with Integrated Windows or Basic authentication, you must configure GraphQL with Basic authentication.
HTTPS is required to secure credentials.
For OpenID Connect providers, you need to pass the access token as a bearer token in the Authorization header; for example, Authorization: Bearer <ACCESS TOKEN>(replace<ACCESS TOKEN> with your access token).
The GraphQL Node.js app code inside the \wfgen\graphql folder can also be customized to accommodate many other authentication methods (such as OAuth2, JWT, etc.) thanks to node libraries such as Passport.js.

System access users

Some operations (such as UpdateRequestDataset) require users to have system access to perform the operations. This can be configured in the System operations allowed users field, under Security on the Integration tab in the Configuration Panel.

User impersonation

User impersonation is supported but not recommended, and should be used only when no other technical solutions are possible. (For example, OpenID Connect-based authentication methods allow you to use access tokens to perform API operations on the client and server sides without impersonation.)
System operations allowed users can impersonate another WorkflowGen user account by setting this account's username as the value of the x-wfgen-impersonate-username HTTP request header.
This request header can be renamed according to your naming convention. You can specify a new header name in the GraphqlImpersonateUserNameHttpHeader setting in the \wfgen\web.config file (e.g. <add key="GraphqlImpersonateUserNameHttpHeader" value="my-custom-impersonate-username" />).
To give or withdraw system operations rights to or from specific users, refer to the System operations allowed users setting in the Security section on the General tab of the Configuration Panel; alternately, you can edit the ProcessesRuntimeWebServiceAllowedUsers setting in the \wfgen\web.config file.

Delegation mode

Some GraphQL queries and operations can be executed on behalf of another user. This is possible when a user has created a delegation in WorkflowGen. The delegatee has to specify the user ID of his delegator in the onBehalfOf argument.
List of actions to do on by the delegatee on behalf of the delegator with the user ID VXNlcjoy:
1
{
2
viewer {
3
actions(filter: {as: ASSIGNEE, status: OPEN}, onBehalfOf:"VXNlcjoy"}) {
4
totalCount
5
hasNextPage
6
hasPreviousPage
7
items {
8
request {
9
number
10
description
11
}
12
number
13
name
14
description
15
limit
16
launchUrl
17
}
18
}
19
}
20
}
Copied!
When the onBehalfOf argument is set, it is propagated implicitly to the all the sub-queries and fields until a User type is used.

Global identifiers

Each GraphQL type has an id: ID! field. This ID is global and is unique for all WorkflowGen objects.
You can use the node(id:ID!) query to retrieve a WorkflowGen object by its ID.
1
{
2
node(id: "UHJvY2VzczoxNQ==") {
3
id
4
... on Request {
5
number
6
requester {
7
lastName
8
}
9
}
10
... on Action {
11
limit
12
assignee {
13
id
14
company
15
}
16
}
17
... on User {
18
userName
19
email
20
}
21
}
22
}
Copied!

GraphQL queries

You can copy/paste these queries directly in the GraphiQL IDE. See the Using GraphiQL IDE in a web browser section above for more information.

Using Curl

1
curl -X POST http://localhost/wfgen/graphql -H "Content-Type: application/x-www-form-urlencoded" -d "query={ viewer { userName lastName firstName email } }"
Copied!
And the result is:
1
{
2
"data": {
3
"viewer": {
4
"userName": "johndoe",
5
"lastName": "Doe",
6
"firstName": "John",
7
"email": "[email protected]"
8
}
9
}
10
}
Copied!

Viewer basic info (the authenticated user)

1
{
2
viewer {
3
userName
4
lastName
5
firstName
6
email
7
}
8
}
Copied!

My actions to do

1
{
2
viewer {
3
actions(filter: {as: ASSIGNEE, status: OPEN}) {
4
totalCount
5
hasNextPage
6
hasPreviousPage
7
items {
8
request {
9
number
10
description
11
}
12
number
13
name
14
description
15
limit
16
launchUrl
17
}
18
}
19
}
20
}
Copied!

Fetch a request by its number

1
{
2
request(number: 273) {
3
description
4
requester {
5
lastName
6
userName
7
company
8
}
9
process {
10
name
11
version
12
}
13
}
14
}
Copied!

Request mutations

Create a new request

To create a new request from the GraphQL API, make sure that sub-process mode is enabled with public access on the target process. (See the Process form section in the WorkflowGen Administration Guide for more information.)

Request payload:

1
mutation {
2
createRequest(input: {
3
processName: "2_LEVELS_APPROVAL",
4
processVersion: 1
5
}) {
6
request {
7
id
8
name
9
number
10
}
11
}
12
}
Copied!

Response payload:

1
{
2
"data": {
3
"createRequest": {
4
"request": {
5
"id": "UmVxdWVzdDoxNQ==",
6
"name": "2_LEVELS_APPROVAL #15",
7
"number": 15
8
}
9
}
10
}
11
}
Copied!
A parameter's array can be included in the createRequest operation payload. Be aware that a data with the same name and data type must previously exist in the process for each parameter in the array to store the parameter's value. The following example shows how to send parameters corresponding to the four supported data types (TEXT, NUMERIC, DATETIME, and FILE).

Request payload:

1
mutation {
2
createRequest(input: {processName: "SR", processVersion: 1, parameters: [{name: "TEXT", textValue: "My text parameter"}, {name: "NUMERIC", numericValue: 5}, {name: "DATE", dateTimeValue: "2017-02-23T20:46:00Z"}, {name: "FILE", fileValue: {name: "TestFile.txt", contentType: "text/plain", size: 616, url: "file:///c:/TestFile.txt", updatedAt: "2017-02-21T15:06:38Z"}}]}) {
3
request {
4
id
5
name
6
number
7
}
8
}
9
}
Copied!

Response payload:

1
{
2
"data": {
3
"createRequest": {
4
"request": {
5
"id": "UmVxdWVzdDoxNg==",
6
"name": "2_LEVELS_APPROVAL #16",
7
"number": 16
8
}
9
}
10
}
11
}
Copied!
For more information on FILE parameter manipulations when sent within GraphQL payloads, see the File upload section.

Update request dataset

A request dataset context can be updated by adding a parameter array. In this case a request number or a request ID should be provided.

Request payload:

1
mutation {
2
updateRequestDataset(input: {
3
number: 22,
4
parameters: {
5
name: "TEXT",
6
textValue: "My text parameter"
7
}
8
}) {
9
dataset {
10
items {
11
name
12
textValue
13
}
14
}
15
}
16
}
Copied!

Response payload:

1
{
2
"data": {
3
"updateRequestDataset": {
4
"dataset": {
5
"items": [
6
{
7
"name": "TEXT",
8
"textValue": "My text parameter"
9
}
10
]
11
}
12
}
13
}
14
}
Copied!

Cancel a request

You can cancel a request by using the request number or the request ID.

Request payload:

1
mutation {
2
cancelRequest(input: {
3
number: 15
4
}) {
5
request {
6
id
7
name
8
number
9
status
10
}
11
}
12
}
Copied!

Response payload:

1
{
2
"data": {
3
"cancelRequest": {
4
"request": {
5
"id": "UmVxdWVzdDoxNQ==",
6
"name": "SR #15",
7
"number": 15,
8
"status": "CLOSED"
9
}
10
}
11
}
12
}
Copied!

Delete a request

A request can be deleted by using the request number or the request ID.

Request payloads:

1
mutation {
2
deleteRequest(input: {
3
number: 15
4
}) {
5
clientMutationId
6
}
7
}
Copied!
1
mutation {
2
deleteRequest(input: {
3
id: "UmVxdWVzdDoxNQ=="
4
}) {
5
clientMutationId
6
}
7
}
Copied!

Response payload:

1
{
2
"data": {
3
"deleteRequest": {
4
"clientMutationId": null
5
}
6
}
7
}
Copied!

Action mutations

Complete an action

To complete an action, provide the request number and the action number, or the action ID.

Request payload:

1
mutation {
2
completeAction(input: {
3
requestNumber: 16,
4
number: 1
5
}) {
6
action {
7
id
8
status
9
}
10
}
11
}
Copied!

Response payload:

1
{
2
"data": {
3
"completeAction": {
4
"action": {
5
"id": "QWN0aW9uOjE2LS0tMQ==",
6
"status": "CLOSED"
7
}
8
}
9
}
10
}
Copied!
To complete an action, a parameter array can be included in the request payload arguments.

Request payload:

1
mutation {
2
completeAction(input: {
3
requestNumber: 20,
4
number: 1,
5
parameters: [{
6
name: "NEW_PARAMETER",
7
textValue: "My parameter"
8
}]
9
}) {
10
action {
11
id
12
status
13
}
14
}
15
}
Copied!

Response payload:

1
{
2
"data": {
3
"completeAction": {
4
"action": {
5
"id": "QWN0aW9uOjIwLS0tMQ==",
6
"status": "CLOSED"
7
}
8
}
9
}
10
}
Copied!

Complete a form action

This mutation completes a form action (EFORMASPX action with ASP.NET web form) and also updates the form archive and form data files.

Request payload:

1
mutation {
2
completeFormAction(input: {
3
requestNumber: 20,
4
number: 1,
5
parameters: [{
6
name: "NEW_PARAMETER",
7
textValue: "My parameter"
8
}]
9
}) {
10
action {
11
id
12
status
13
}
14
}
15
}
Copied!

Response payload:

1
{
2
"data": {
3
"completeFormAction": {
4
"action": {
5
"id": "QWN0aW9uOjIwLS0tMQ==",
6
"status": "CLOSED"
7
}
8
}
9
}
10
}
Copied!

Cancel an action

To cancel an action, provide the request number and the action number, or the action ID. The following conditions must be met:
  • The viewer and the user (if they don't share the same identity, as in delegation mode) must have access to the request.
  • The action must be open.
  • The action must have a cancel or default exception defined in the transition.
  • The viewer is:
    • an administrator or process folder manager OR
    • a supervisor with cancellation rights OR
    • the action assignee.

Request payload:

1
mutation {
2
cancelAction(input: {
3
requestNumber: 21,
4
number: 1
5
}) {
6
action {
7
id
8
status
9
}
10
}
11
}
Copied!

Response payload:

1
{
2
"data": {
3
"cancelAction": {
4
"action": {
5
"id": "QWN0aW9uOjIxLS0tMQ==",
6
"status": "CLOSED"
7
}
8
}
9
}
10
}
Copied!

Cancel a request's actions by name

All of the actions with the same name in a request can be cancelled at the same time by using their name in this operation payload. The following conditions are met:
  • The viewer and the user (if they do not share the same identity, as in delegation mode) must have access to the request.
  • The action must be open.
  • The action must have a cancel or default exception defined in the transition.
  • The viewer is:
    • an administrator or a process folder manager OR
    • a supervisor with cancellation rights OR
    • the action assignee.

Request payload:

1
mutation {
2
cancelRequestActionsByName(input: {
3
requestNumber: 21,
4
activityName: "INITIATES"
5
}) {
6
action {
7
id
8
status
9
}
10
}
11
}
Copied!

Response payload:

1
{
2
"data": {
3
"cancelAction": {
4
"action": {
5
"id": "QWN0aW9uOjIxLS0tMQ==",
6
"status": "CLOSED"
7
}
8
}
9
}
10
}
Copied!

Assign an action

To assign an action, provide the request number and the action number, or the action ID; you must also provide the assigneeUserName or the assigneeId.

Request payload:

1
mutation {
2
assignAction(input: {
3
requestNumber: 22,
4
number: 1,
5
assigneeId: "VXNlcjox"
6
}) {
7
action {
8
id
9
assignee {
10
id
11
}
12
}
13
}
14
}
Copied!

Response payload:

1
{
2
"data": {
3
"assignAction": {
4
"action": {
5
"id": "QWN0aW9uOjIyLS0tMQ==",
6
"assignee": {
7
"id": "VXNlcjox"
8
}
9
}
10
}
11
}
12
}
Copied!

Cancel an action assignment

To cancel an action assignment, you should provide the request number and the action number, or the action ID.

Request payload:

1
mutation {
2
cancelActionAssignment(input: {
3
requestNumber: 22,
4
number: 1
5
}) {
6
action {
7
id
8
assignee {
9
id
10
}
11
}
12
}
13
}
Copied!

Response payload:

1
{
2
"data": {
3
"cancelActionAssignment": {
4
"action": {
5
"id": "QWN0aW9uOjIyLS0tMQ==",
6
"assignee": null
7
}
8
}
9
}
10
}
Copied!

End-user mutations

Create a favorite

GraphQL lets users add processes and views to their favorites lists using the process or view IDs.

Request payload:

1
mutation {
2
createFavorite(input: {
3
itemId: "UHJvY2Vzczoy"
4
}) {
5
favorite {
6
id
7
type
8
}
9
}
10
}
Copied!

Response payload:

1
{
2
"data": {
3
"createFavorite": {
4
"favorite": {
5
"id": "RmF2b3JpdGU6MQ==",
6
"type": "PROCESS"
7
}
8
}
9
}
10
}
Copied!
This code will create a favorite using the process or view description, but adding a custom description is also possible, as shown in the following example:

Request payload:

1
mutation {
2
createFavorite(input: {
3
itemId: "UHJvY2Vzczoy",
4
description: "My custom description"
5
}) {
6
favorite {
7
id
8
type
9
description
10
}
11
}
12
}
Copied!

Response payload:

1
{
2
"data": {
3
"createFavorite": {
4
"favorite": {
5
"id": "RmF2b3JpdGU6MQ==",
6
"type": "PROCESS",
7
"description": "My custom description"
8
}
9
}
10
}
11
}
Copied!

Update a favorite

GraphQL lets users update an existing favorite process or view by using its favorite ID.

Request payload:

1
mutation {
2
updateFavorite(input: {
3
id: "RmF2b3JpdGU6MQ==",
4
description: "Updated description"
5
}) {
6
favorite {
7
id
8
type
9
description
10
}
11
}
12
}
Copied!

Response payload:

1
{
2
"data": {
3
"updateFavorite": {
4
"favorite": {
5
"id": "RmF2b3JpdGU6MQ==",
6
"type": "PROCESS",
7
"description": "Updated description"
8
}
9
}
10
}
11
}
Copied!

Delete a favorite

GraphQL lets users delete an existing favorite process or view from their favorites list by using its favorites ID.

Request payload:

1
mutation {
2
deleteFavorite(input: {
3
id: "RmF2b3JpdGU6MQ=="
4
}) {
5
clientMutationId
6
}
7
}
Copied!

Response payload:

1
{
2
"data": {
3
"deleteFavorite": {
4
"clientMutationId": null
5
}
6
}
7
}
Copied!

Add a comment

GraphQL lets users add comments to requests.

Request payload:

1
mutation {
2
addComment(input: {
3
subjectId: "UmVxdWVzdDoyMg==",
4
message: "This is my message"
5
}) {
6
comment {
7
subject {
8
id
9
}
10
message
11
}
12
}
13
}
Copied!

Response payload:

1
{
2
"data": {
3
"addComment": {
4
"comment": {
5
"subject": {
6
"id": "UmVxdWVzdDoyMg=="
7
},
8
"message": "This is my message"
9
}
10
}
11
}
12
}
Copied!

Update a comment

Users can update comments if they are administrators, process manager of the process or process supervisor, or standard users who are members of the process participants, have write permissions, and are the comment author.

Request payload:

1
mutation {
2
updateComment(input: {
3
id: "Q29tbWVudDoyMi0tLTE=",
4
message: "This is my updated message"
5
}) {
6
comment {
7
message
8
}
9
}
10
}
Copied!

Response payload:

1
{
2
"data": {
3
"updateComment": {
4
"comment": {
5
"message": "This is my updated message"
6
}
7
}
8
}
9
}
Copied!

Remove a comment

GraphQL lets users remove comments from requests.

Request payload:

1
mutation {
2
removeComment(input: {
3
id: "Q29tbWVudDoyMi0tLTE="
4
}) {
5
clientMutationId
6
}
7
}
Copied!

Response payload:

1
{
2
"data": {
3
"removeComment": {
4
"clientMutationId": null
5
}
6
}
7
}
Copied!

Delegation mutations

Create a delegation

This mutation requires that the portal delegation feature be enabled. Standard users can only create delegations for themselves; only administrators can create a delegation for another user.

Request payload:

1
mutation {
2
createDelegation(input: {
3
delegatorId: "VXNlcjox",
4
delegateeId: "VXNlcjoy",
5
processId: "UHJvY2Vzczoz",
6
participantId: "TG9jYWxQcm9jZXNzUGFydGljaXBhbnQ6OA==",
7
start: "2017-04-23T18:25:43.000Z",
8
end: "2017-11-23T18:25:43.000Z",
9
notifyDelegatee: true
10
}) {
11
delegation {
12
id
13
}
14
}
15
}
Copied!

Response payload:

1
{
2
"data": {
3
"createDelegation": {
4
"delegation": {
5
"id": "RGVsZWdhdGlvbjoxMA=="
6
}
7
}
8
}
9
}
Copied!

Update a delegation

This mutation requires that the portal delegation feature be enabled. Standard users can only update delegations for themselves; only administrators can update a delegation for another user.

Request payload:

1
mutation {
2
updateDelegation(input: {
3
id: "RGVsZWdhdGlvbjoxMA==",
4
start: "2018-05-01T00:00:00.000Z",
5
end: "2018-9-01T00:00:00.000Z",
6
notifyDelegatee: true
7
}) {
8
delegation {
9
id
10
}
11
}
12
}
Copied!

Response payload:

1
{
2
"data": {
3
"updateDelegation": {
4
"delegation": {
5
"id": "RGVsZWdhdGlvbjoxMA=="
6
}
7
}
8
}
9
}
Copied!

Delete a delegation

This mutation requires that the portal delegation feature be enabled. Standard users can only delete their own delegations; only administrators can delete another user's delegations.

Request payload:

1
mutation {
2
deleteDelegation(input: {
3
id: "RGVsZWdhdGlvbjoxMA=="
4
}) {
5
clientMutationId
6
}
7
}
Copied!

Response payload:

1
{
2
"data": {
3
"deleteDelegation": {
4
"clientMutationId": null
5
}
6
}
7
}
Copied!

Category mutations

Create a category

Only administrators can create a category.

Request payload:

1
mutation {
2
createCategory(input: {
3
name: "my category",
4
description: "My category description"
5
}) {
6
category {
7
name
8
description
9
}
10
}
11
}
Copied!

Response payload:

1
{
2
"data": {
3
"createCategory": {
4
"category": {
5
"name": "MY_CATEGORY",
6
"description": "My category description"
7
}
8
}
9
}
10
}
Copied!

Update a category

Only administrators can update a category.

Request payload:

1
mutation {
2
updateCategory(input: {
3
id: "Q2F0ZWdvcnk6Mg==",
4
name: "My updated category name"
5
}) {
6
category {
7
id
8
name
9
description
10
}
11
}
12
}
Copied!

Response payload:

1
{
2
"data": {
3
"updateCategory": {
4
"category": {
5
"id": "Q2F0ZWdvcnk6Mg==",
6
"name": "MY_UPDATED_CATEGORY_NAME",
7
"description": "My category description"
8
}
9
}
10
}
11
}
Copied!

Delete a category

Only administrators can delete a category.

Request payload:

1
mutation {
2
deleteCategory(input: {
3
id: "Q2F0ZWdvcnk6Mg=="
4
}) {
5
clientMutationId
6
}
7
}
Copied!

Response payload:

1
{
2
"data": {
3
"deleteCategory": {
4
"clientMutationId": null
5
}
6
}
7
}
Copied!

Process folder mutations

Create a process folder

Only administrators can create a process folder.

Request payload:

1
mutation {
2
createProcessFolder(input: {
3
name: "Human Resources processes folder",
4
description: "Human Resources processes folder",
5
managerId: "R2xvYmFsUGFydGljaXBhbnQ6MQ=="
6
}) {
7
processFolder {
8
id
9
name
10
description
11
manager {
12
id
13
name
14
}
15
}
16
}
17
}
Copied!

Response payload:

1
{
2
"data": {
3
"createProcessFolder": {
4
"processFolder": {
5
"id": "UHJvY2Vzc0ZvbGRlcjoz",
6
"name": "HUMAN_RESOURCES_PROCESSES_FOLDER",
7
"description": "Human Resources processes folder",
8
"manager": {
9
"id": "R2xvYmFsUGFydGljaXBhbnQ6MQ==",
10
"name": "DEFAULT_PROCESSMANAGER"
11
}
12
}
13
}
14
}
15
}
Copied!

Update a process folder

Only administrators and the process folder manager can update a process folder.

Request payload:

1
mutation {
2
updateProcessFolder(input: {
3
id: "UHJvY2Vzc0ZvbGRlcjoz",
4
name: "Updated processes folder"
5
}) {
6
processFolder {
7
id
8
name
9
description
10
manager {
11
id
12
name
13
}
14
}
15
}
16
}
Copied!

Response payload:

1
{
2
"data": {
3
"updateProcessFolder": {
4
"processFolder": {
5
"id": "UHJvY2Vzc0ZvbGRlcjoz",
6
"name": "UPDATED_PROCESSES_FOLDER",
7
"description": "Human Resources processes folder",
8
"manager": {
9
"id": "R2xvYmFsUGFydGljaXBhbnQ6MQ==",
10
"name": "DEFAULT_PROCESSMANAGER"
11
}
12
}
13
}
14
}
15
}
Copied!

Delete a process folder

Only administrators can delete a process folder.

Request payload:

1
mutation {
2
deleteProcessFolder(input: {
3
id: "UHJvY2Vzc0ZvbGRlcjoz"
4
}) {
5
clientMutationId