API for tasks
Access and control task-related functions through the GraphQL API using the Nintex endpoint. This API can be used to:
-
Add a task.
-
Retrieve information of a task.
Before you begin:
-
Learn the fundamentals of GraphQL, the query language used to request and manage data through the Nintex public API.
-
Understand how to create effective queries and mutations to make requests and interact with the API.
-
Learn how to get and authenticate an access token.
-
Discover and understand the available endpoints.
type TaskEntityConfiguration {
extraData: String
notifications: String
variables: String
notifiers: JSON
outputVariables: [String]
}
type TaskEntity {
id: ID!
tenantId: ID!
name: String!
state: String!
priority: Int!
queueId: ID!
queueName: String!
wizardId: String!
wizardName: String!
customWizardName: String
robotId : ID
robotName: String
producerId: ID!
producerType: String!
createdAt: DateTime!
configuration: TaskEntityConfiguration!
workflowState: String
}
extend type Query {
taskById(id: ID!): TaskEntity
}
API requests
The following API requests provide the ability to manage tasks using the Nintex endpoint:
QUERY
mutation ($task: AddTaskInput!) {
addTask(task: $task) {
id
name
tenantId
priority
queueId
wizardId
variables
notifiers
}
}
GRAPHQL VARIABLES
{
queueId: "5d1991c6-8c86-4ff2-a90c-130e3242cbf1",
name: "TaskTest",
wizardId: "10004",
priority: 1,
variables: [
{name: "name", value: "test"}
],
notifiers: {
ended: {
webhook: {
urls: ["http://dev.com:3939"],
retryTimeoutMinutes: 300
}
}
}
}
RESPONSE
{
"data": {
"addTask": {
id: "9n1921c6-8c56-4ff2-a90c-130e3242cbg1"
name: "TaskTest"
priority: 1
queueId: "5d1991c6-8c86-4ff2-a90c-130e3242cbf1"
tenantId: 1
wizardId: "10004"
variables: [
{name: "name", value: "test"}
],
notifiers: {
ended: {
webhook: {
urls: ["http://dev.com:3939"],
retryTimeoutMinutes: 300
}
}
}
}
}
}
You will be required to submit a task ID when you want to use this API. You can take obtain the task ID when you execute the Add task API. When you add a task, the task's ID will be provided in the Response.
QUERY
query taskById($id: ID!){
taskById(id: $id) {
id
tenantId
name
state
priority
queueId
queueName
wizardId
wizardName
customWizardName
robotId
robotName
producerId
producerType
createdAt
configuration {
extraData
notifications
variables
notifiers
outputVariables
}
workflowState
}
}
RESPONSE
{
"data": {
"taskById": {
"id": "b320d021-1944-456e-92c1-f2756d6bacf4",
"tenantId": "1",
"name": "trigger_time_5131 (#011024083000)",
"state": "ended",
"priority": 0,
"queueId": "285ad22d-2be5-45fe-99e9-a8f0e09cb5b8",
"queueName": "queue_2575",
"wizardId": "2",
"wizardName": "wizard_sanity_tests_6730",
"customWizardName": "",
"robotId": "a2880a4a-76ed-46f8-9bb4-c188caa330ff",
"robotName": "AutomationRobot_sanity_test",
"producerId": "971cc34d-fd11-457e-a0ec-dd8f86c78371",
"producerType": "kryon-scheduled",
"createdAt": "2024-10-01T05:30:00.097Z",
"configuration": {
"extraData": "{}",
"notifications": "{}",
"variables": "[]",
"notifiers": null,
"outputVariables": null
}
"workflowState": "success"
}
}
}