https://prefect.io logo
Title
w

William Smith

08/20/2020, 2:29 PM
Hi all, are there any examples where a task can be paused awaiting some sort of manual approval?
manual_only trigger, just found it nvm
d

Dylan

08/20/2020, 2:38 PM
Glad you found it!
w

William Smith

08/20/2020, 3:55 PM
@Dylan When I resume a manual step, why does it take so long to execute the manual task? I click resume straight away but it cant take ~10 mins or more for the agent to pick it up
Keep seeing this in the logs
Rescheduled by a Lazarus process. This is attempt 1.
d

Dylan

08/20/2020, 4:00 PM
Hi @William Smith
I think this is the same issue, you have a Flow Run concurrency limit of 1
So the resumed flow has to wait for other running flows to finish
w

William Smith

08/20/2020, 4:02 PM
Ah OK, didn't think I had another flow running but I will check.....
I only have one flow executing, but it is paused awaiting the manual step, when I click approve it doesn't seem to want to continue. Almost like it's waiting for the initial run to timeout before the manual step can get picked up.
If that makes sense....
I'm just assuming
Task 'Manual Approval': Handling state change from Pending to Paused
Task 'Manual Approval': finished task run for task with final state: 'Paused'
Task Manual Approval approved
Last 3 log statements
So the last take in the flow is a manual step, that seems to pause the flow
but when I approve it, it doesn't resume straight away
d

Dylan

08/20/2020, 4:10 PM
That does look weird
w

William Smith

08/20/2020, 4:10 PM
Have to wait for it to be rescheduled by the lazurus process
d

Dylan

08/20/2020, 4:10 PM
Let me check with the team real quick and see what they think
w

William Smith

08/20/2020, 4:11 PM
Great thanks
d

Dylan

08/20/2020, 4:11 PM
Once you put the flow run into a
Resume
state, your agent should re-pick up the run
Do you have a result configured?
w

William Smith

08/20/2020, 4:12 PM
No, what do you mean?
d

Dylan

08/20/2020, 4:13 PM
Ah okay
You’ll need to configure a result
I’ll explain in more detail
But first:
Basically, we don’t want your infrastructure or the run spinning out there in the cloud when a flow is in a
Paused
state
So, what happens behind the scenes is the flow run actually shuts down
and when it’s put into a
Resume
state, the agent re-pulls the flow run from cloud
Because Prefect never stores your data, we need to be able to read the result of the previous task runs from somewhere
in order to resume
We should have better logging / error messaging on this
Let me know if adding a result solves the issue
if it does I’ll open an issue for us to improve this experience
w

William Smith

08/20/2020, 4:18 PM
so you're saying I need to add a result to the manual task? But the manual task is never executed until it is rescheduled by lazurus
d

Dylan

08/20/2020, 4:18 PM
Can you post a reproducible example here?
w

William Smith

08/20/2020, 4:19 PM
Sure
Two secs
d

Dylan

08/20/2020, 4:19 PM
👍
w

William Smith

08/20/2020, 4:25 PM
Very simple flow, 3 tasks, go into one manual step task
I'm just experimenting here so perhaps I've missed something obvious
d

Dylan

08/20/2020, 4:29 PM
Yup, I think you need a result
The Lazarus process doesn’t actually re-start a manual flow run
The flow run is re-queued for execution and the agent re-submits the work
and the original process for the running flow run has been killed
and a new one needs to be started by the agent
Try configuring a
LocalResult
w

William Smith

08/20/2020, 4:33 PM
So configure/return a localresult for the manual step?
I'm going to have to dash but I'll give this a go
thanks for your help 🙂
d

Dylan

08/20/2020, 4:35 PM
I’d go ahead and do it for the whole flow
Anytime!
w

William Smith

08/20/2020, 4:35 PM
May come back to this tomorrow/Monday
Thanks again!
d

Dylan

08/20/2020, 4:36 PM
👍
w

William Smith

08/24/2020, 12:20 PM
Hi @Dylan, I took your advice and tried to add a LocalResult to all my tasks, unfortunately this didn't seem to work
All my tasks have the following signature
@task(name = "Get Reference Data", result=LocalResult(dir='~/Desktop/Credit/results'))
And data is being stored there
but again the flow isn't resumed straight away