You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,7 @@ This package lets you run AWS Step Functions state machines completely locally,
41
41
-[Overriding Task and Wait states](#overriding-task-and-wait-states)
42
42
-[Task state override](#task-state-override)
43
43
-[Wait state override](#wait-state-override)
44
+
-[Retry field pause override](#retry-field-pause-override)
44
45
-[Passing a custom Context Object](#passing-a-custom-context-object)
45
46
-[Disabling ASL validations](#disabling-asl-validations)
46
47
-[Exit codes](#exit-codes)
@@ -362,6 +363,54 @@ local-sfn \
362
363
363
364
This command would execute the state machine, and override `Wait` states `WaitResponse` and `PauseUntilSignal` to pause the execution for 1500 and 250 milliseconds, respectively. The `Delay` state wouldn't be paused at all, since the override value is set to 0.
364
365
366
+
#### Retry field pause override
367
+
368
+
To override the duration of the pause in the `Retry` field of a state, pass the `-r, --override-retry` option. This option takes as value the name of the state whose `Retry` field you want to override, and a number that represents the amount in milliseconds that you want to pause the execution for before retrying the state. The state name and the milliseconds amount must be separated by a colon `:`.
369
+
370
+
For example, suppose the state machine definition contains a state called `TaskToRetry` that is defined as follows:
This command would execute the state machine, and if the `TaskToRetry` state fails, the execution would be paused for 100 milliseconds before retrying the state again, disregarding the `IntervalSeconds`, `BackoffRate`, `MaxDelaySeconds`, and `JitterStrategy` fields that could've been specified in any of the `Retry` field retriers.
392
+
393
+
Alternatively, you can also pass a list of comma-separated numbers as value, to override the duration of specific retriers, for instance:
The above command would pause the execution for 100 milliseconds if the state error is matched by the first retrier and it would pause for 20 milliseconds if the error matches the third retrier. Note that a -1 was passed for the second retrier. This means that the pause duration of the second retrier will not be overridden, instead, it will be calculated as usually with the `IntervalSeconds` and the other retrier fields, or use the default values if said fields are not specified.
400
+
401
+
Furthermore, you can pass this option multiple times, to override the `Retry` fields in multiple states. For example:
402
+
403
+
```sh
404
+
local-sfn \
405
+
-f state-machine.json \
406
+
-r SendRequest:1500 \
407
+
-r ProcessData:250 \
408
+
-r MapResponses:0 \
409
+
'{ "num1": 1, "num2": 2 }'
410
+
```
411
+
412
+
This command would execute the state machine, and override the duration of the retry pause in states `SendRequest` and `ProcessData` to pause the execution for 1500 and 250 milliseconds, respectively. The retry in the `MapResponses` state wouldn't be paused at all, since the override value is set to 0.
413
+
365
414
### Passing a custom Context Object
366
415
367
416
If the JSONPaths in your definition reference the Context Object, you can provide a mock Context Object by passing either the `--context` or the `--context-file` option. For example, given the following definition:
0 commit comments