Hi all, are there any examples where a task can be...
# prefect-community
w
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
Glad you found it!
w
@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
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
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
That does look weird
w
Have to wait for it to be rescheduled by the lazurus process
d
Let me check with the team real quick and see what they think
w
Great thanks
d
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
No, what do you mean?
d
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
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
Can you post a reproducible example here?
w
Sure
Two secs
d
👍
w
Very simple flow, 3 tasks, go into one manual step task
I'm just experimenting here so perhaps I've missed something obvious
d
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
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
I’d go ahead and do it for the whole flow
Anytime!
w
May come back to this tomorrow/Monday
Thanks again!
d
👍
w
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