Skip to main content

Caching Task Outputs

Some task types support caching, which saves task outputs for reuse in subsequent tasks. This feature can be configured in the task configuration.

To cache task output:

  1. In your Orkes Conductor cluster, go to Definitions > Workflow and select a workflow.
  2. In the visual workflow editor, select a task.
  3. Turn on the Cache output toggle and enter the ttlInSecond and key. Refer to Configuration for more information on the parameters.

Configuring cache output in UI.

Configuration

Configure the following parameters to enable task caching.

ParameterDescriptionRequired/ Optional
cacheConfig. ttlInSecondThe time to live in seconds, which is the duration for the output to be cached.Required.
cacheConfig. keyThe cache key, which is a unique identifier for the cached output.

The key should be constructed as a string of dynamic task inputs, such as ${uri}-${method}.
Required.

Example

//task configuration

"cacheConfig": {
"ttlInSecond": 36000,
"key": "${uri}-${method}"
}

Task behavior with caching

Before a task is scheduled, the server checks if there is cached output for the given task definition name by matching the cache key. If a match is found, the task does not get scheduled, and the cached output is used to complete the task.

If no cached output is found, the task is scheduled as usual. When the task is completed successfully, the output is cached against the cache key for the duration specified.

Supported tasks

Caching is currently supported for the following task types: