So here’s a very simple example below which works for me.
ubuntu@cadmus:~/st2$ cat /opt/stackstorm/packs/sandbox/actions/workflows/pause_before.yaml
version: '2.0'
sandbox.pause_before:
tasks:
task1:
action: core.noop
on-success:
- task2
task2:
pause-before: true
action: core.noop
on-success:
- task3
task3:
action: core.noop
Running the above workflow result in the following. Please note that the execution automatically paused.
Then I manually resumed the execution and it succeeded.
ubuntu@cadmus:~/st2$ st2 run sandbox.pause_before -a
To get the results, execute:
st2 execution get 5b46656b8006e60b0b18e128
To view output in real-time, execute:
st2 execution tail 5b46656b8006e60b0b18e128
ubuntu@cadmus:~/st2$ st2 execution get 5b46656b8006e60b0b18e128
id: 5b46656b8006e60b0b18e128
action.ref: sandbox.pause_before
parameters: None
status: paused
start_timestamp: Wed, 11 Jul 2018 20:15:39 UTC
end_timestamp:
result:
tasks: []
+--------------------------+------------------------+-------+-----------+-----------------+
| id | status | task | action | start_timestamp |
+--------------------------+------------------------+-------+-----------+-----------------+
| 5b46656c8006e60b0b18e12b | succeeded (0s elapsed) | task1 | core.noop | Wed, 11 Jul |
| | | | | 2018 20:15:40 |
| | | | | UTC |
+--------------------------+------------------------+-------+-----------+-----------------+
ubuntu@cadmus:~/st2$ st2 execution resume 5b46656b8006e60b0b18e128
id: 5b46656b8006e60b0b18e128
action.ref: sandbox.pause_before
parameters: None
status: resuming
start_timestamp: Wed, 11 Jul 2018 20:15:39 UTC
end_timestamp:
result:
tasks: []
+--------------------------+------------------------+-------+-----------+-----------------+
| id | status | task | action | start_timestamp |
+--------------------------+------------------------+-------+-----------+-----------------+
| 5b46656c8006e60b0b18e12b | succeeded (0s elapsed) | task1 | core.noop | Wed, 11 Jul |
| | | | | 2018 20:15:40 |
| | | | | UTC |
+--------------------------+------------------------+-------+-----------+-----------------+
ubuntu@cadmus:~/st2$ st2 execution get 5b46656b8006e60b0b18e128
id: 5b46656b8006e60b0b18e128
action.ref: sandbox.pause_before
parameters: None
status: succeeded (21s elapsed)
result_task: task3
result:
failed: false
return_code: 0
succeeded: true
start_timestamp: Wed, 11 Jul 2018 20:15:39 UTC
end_timestamp: Wed, 11 Jul 2018 20:16:00 UTC
+--------------------------+------------------------+-------+-----------+-----------------+
| id | status | task | action | start_timestamp |
+--------------------------+------------------------+-------+-----------+-----------------+
| 5b46656c8006e60b0b18e12b | succeeded (0s elapsed) | task1 | core.noop | Wed, 11 Jul |
| | | | | 2018 20:15:40 |
| | | | | UTC |
| 5b46657e8006e60b0b18e12d | succeeded (1s elapsed) | task2 | core.noop | Wed, 11 Jul |
| | | | | 2018 20:15:58 |
| | | | | UTC |
| 5b46657f8006e60b0b18e12f | succeeded (0s elapsed) | task3 | core.noop | Wed, 11 Jul |
| | | | | 2018 20:15:59 |
| | | | | UTC |
+--------------------------+------------------------+-------+-----------+-----------------+