Skip to content

GraphQL API Definition

The following document outlines the AireFlow GraphQL API, available at /api/graphql/v2.

Tasks

The tasks query can be used to read all instantiated tasks. There are currently no mutations available via GraphQL and any changes will need to be made via the REST API.

Query Structure

The following properties can be retrieved via the GraphQL API

query {
    tasks {
        pageCount
        nodes {
            id
            taskKey
            name
            description
            taskType
            subjectId
            correlationId
            assigneeId
            assigneeType
            owner
            ownerType
            workflowDefinitionVersion
            workflowDefinitionId
            filters
            context
            created
            updated
            lastRun
            activityContext {
                status
                ...on ManualActivityContext {
                    due
                }
                ...on EmailActivityContext {
                    to
                    subject
                    body
                    retryCount
                }
                ...on HttpActivityContext {
                    url
                    body
                    contentType
                    headers
                    retryCount
                }
                ...on AireFrameCreateFormActivityContext {
                    key
                    version
                    subjectId
                    userId
                    retryCount
                }
                ...on PublishEventActivityContext {
                    eventKey
                    retryCount
                }
                ...on FormActivityContext {
                    key
                    version
                    instanceId
                    due
                }
            }
            state {
                key
                value
            }
        }
    }
}

Filtering

The filter parameter is used as follows. Each item in the filter array must be true for a task to be included in the result:

query {
    tasks (
        filter:[{
            property: "activityContext.status"
            condition: EQ
            value: ["New", "InProgress"]
    },
    {
            property: "assigneeId"
            condition: EQ
            value: "1"
    },    
    {
            property: "assigneeType"
            condition: EQ
            value: "Subject"
    },
    {
            property: "state[comments]"
            condition: INCLUDES
            value: "Some Comment"
    }
    ]) {
        ...
    }
}

Where property is the name of the property to filter, condition defines what type of filter is applied and value is the value the condition is checked against. The value can be a string or an array of strings (in some cases). In the above example, the status must be either new or in progress, the assigneeId must be 1 and there is a state item called "comments" who's value includes the substring "Some Comment".

In order to access a nested property, separate them using a '.' as above.

For dictionaries, use {property}.key to filter on the keys, use {property}[{key name}] to filter on the value of a specific key.

Types of Filter

Each property type has a subset of valid conditions listed here.

Property TypeValid ConditionsAccepts Array ValueTrue When
stringEQTrueProperty value equals one of the input values (Case-Sensitive)
NOTTrueProperty value does not equal one of the input values (Case-Sensitive)
INCLUDESTrueOne of the input values is a substring of the property value (Case-Sensitive)
DateTimeLTFalseProperty value is before than the input value
GTFalseProperty value is after the input value
IntEQFalseProperty value is equal to the input value
GTFalseProperty value is greater than the input value
LTFalseProperty value is less than the input value
ListAnyEqFalseProperty list contains the input value
NoneEqFalseProperty list does not contain the input value
EnumEQTrueProperty value equals one of the input values
NOTTrueProperty value does not equal one of the input values
INCLUDESTrueOne of the input values is a substring of the property value
Dictionary KeyAnyEqTrueInput value is a key in the dictionary
NoneEqTrueInput value is not a key in the dictionary
Dictionary ValueEQTrueProperty value equals one of the input values (Case-Sensitive)
NOTTrueProperty value does not equal one of the input values (Case-Sensitive)
INCLUDESTrueOne of the input values is a substring of the property value (Case-Sensitive)

Sorting

The sorting parameter is used as follows. The direction is either ASCENDING or DESCENDING.

query {
    tasks (
        sort: {
            property: "activityContext.due"
            direction: ASCENDING
    }) {
        ...
    }
}

Paging

The paging parameter is used as follows.

query {
    tasks (
        paging: {
            pageNumber: 1,
            pageSize: 50
    }) {
        ...
    }
}