{
ProcessInstances {
id
processId
state
parentProcessInstanceId
rootProcessId
rootProcessInstanceId
variables
nodes {
id
name
type
}
}
}
The Data Index service is a dedicated supporting service that stores the data related to the workflow instances and their associated jobs. This service provides a GraphQL endpoint allowing users to query that data.
The Data Index service processes data received through events, which can originate from any workflow or directly from the Job service.
Data Index supports Apache Kafka or Knative Eventing to consume CloudEvents messages from workflows. It indexes and stores this event data in a database, making it accessible through GraphQL. These events provide detailed information about the workflow execution. The Data Index service is central to OpenShift Serverless Logic search, insights, and management capabilities.
The key features of the Data Index service are as follows:
A flexible data structure
A distributable, cloud-ready format
Message-based communication with workflows via Apache Kafka, Knative, and CloudEvents
A powerful GraphQL-based querying API
When you are using the OpenShift Serverless Operator to deploy workflows, you do not need to manually install or configure the Data Index service. The Operator automatically manages all the necessary configurations for each workflow to connect with it. |
To retrieve data about workflow instances and jobs, you can use GraphQL queries.
You can retrieve information about a specific workflow instance by using the following query example:
{
ProcessInstances {
id
processId
state
parentProcessInstanceId
rootProcessId
rootProcessInstanceId
variables
nodes {
id
name
type
}
}
}
You can retrieve data from a specific job instance by using the following query example:
{
Jobs {
id
status
priority
processId
processInstanceId
executionCounter
}
}
You can filter query results by using the where
parameter, allowing multiple combinations based on workflow attributes.
{
ProcessInstances(where: {state: {equal: ACTIVE}}) {
id
processId
processName
start
state
variables
}
}
{
ProcessInstances(where: {id: {equal: "d43a56b6-fb11-4066-b689-d70386b9a375"}}) {
id
processId
processName
start
state
variables
}
}
By default, filters are combined using the AND Operator. You can modify this behavior by combining filters with the AND or OR operators.
{
ProcessInstances(where: {or: {state: {equal: ACTIVE}, rootProcessId: {isNull: false}}}) {
id
processId
processName
start
end
state
}
}
{
ProcessInstances(where: {and: {processId: {equal: "travels"}, or: {state: {equal: ACTIVE}, rootProcessId: {isNull: false}}}}) {
id
processId
processName
start
end
state
}
}
Depending on the attribute type, you can use the following avaialable Operators:
Attribute type | Available Operators |
---|---|
String array |
|
String |
|
ID |
|
Boolean |
|
Numeric |
|
Date |
|
You can sort query results based on workflow attributes by using the orderBy
parameter. You can also specify the sorting direction in an ascending (ASC
) or a descending (DESC
) order. Multiple attributes are applied in the order you specified.
ASC
order{
ProcessInstances(where: {state: {equal: ACTIVE}}, orderBy: {start: ASC}) {
id
processId
processName
start
end
state
}
}
You can control the number of returned results and specify an offset by using the pagination
parameter.
{
ProcessInstances(where: {state: {equal: ACTIVE}}, orderBy: {start: ASC}, pagination: {limit: 10, offset: 0}) {
id
processId
processName
start
end
state
}
}