Skip to main content
Version: ACE 4

Retry

Overview

Retry step allows to continuously run the specified flow till the condition (retry criteria) is met.

Can be used for API polling.

Configuration

  • Flow - a flow to execute.
  • Flow payload path - path to the payload of data to send to the flow.
  • Target path - path to store the result of the executed flow.
  • Delay between executions (s) - delay in seconds between flow executions.
  • Max number of retries - max number of times flow can be re-executed. If 0 is specified, then flow execution won't be retried and flow is executed only once.
  • Max retry duration (s) - max duration in seconds to retry flow execution.
  • Success condition - retry condition which needs to be met to consider the retry succeeded.
note

Either of Max number of retries or Max retry duration (s) properties is required.

Sample step configuration

Sample step
        name: Step retry
description: ""
stepType: retry
condition: ""
config:
flowId: FlowPolling.yaml
targetPath: flowResult
delayBetweenExecutions: 1
maxRetries: 5
maxRetryDuration: 12
successCondition: '{{flowResult.flowPollingIntermediateResult ===
"sampleRestResponseSuccess"}}'

Examples

RetryTest
        tags: []
sampleInputSchema: ""
sampleData: {}
description: ""
steps:
- name: Step retry
description: ""
stepType: retry
condition: ""
config:
flowId: FlowPolling.yaml
targetPath: flowResult
delayBetweenExecutions: 1
maxRetries: 5
maxRetryDuration: 100
successCondition: '{{flowResult.flowPollingIntermediateResult ===
"sampleRestResponseSuccess"}}'


Assumed API in example http://localhost:9000/sampleRest returns result {"response": "sampleRestResponseSuccess" } in success scenarios and {"response": "sampleRestResponseFailure"} for other scenarios.

FlowPolling
        tags: []
sampleInputSchema: ""
sampleData: {}
description: ""
steps:
- name: Step rest-new
description: ""
config:
endpoint:
url: http://localhost:9000/sampleRest
restRequest: JSON
expectedResponseLocation: body
targetPath: result
headers: {}
oAuthConfig: {}
mtlsConfig: {}
json: {}
disableHeadersInKey: false
stepType: rest-new
condition: ""
- name: Step code-ivm
description: ""
stepType: code-ivm
condition: ""
config:
codeBlock: "return {flowPollingIntermediateResult: result.response};"
targetPath: innerFlowResult
resultPath: innerFlowResult

Input Document and Result

Input document
{}
Flow Result
{
"doc": {
"flowResult": {
"flowPollingIntermediateResult": "sampleRestResponseSuccess"
}
},
"errors": [],
"performance": {
"steps": [
{
"step": "retry",
"executionTime": 29356
}
],
"executionTimeOfFlow": 29356,
"timeMetric": "ms"
}
}