quick q on Pause behavior: is there any way to kno...
# ask-community
b
quick q on Pause behavior: is there any way to know inside a task (e.g. from the prefect context) whether the current run was restarted manually (i.e. by clicking Approve in the UI)? I'm aiming for something like the
manual_only
trigger but that can be achieved at runtime instead. so something like
Copy code
if condition and not prefect.context["manual_approval"]:
    raise signals.PAUSE()
d
Hey @Brett Naul,
resume=True
Should be in the top-level of context whenever manually restarting from Paused
So you should be able to
prefect.context.get("resume")
to determine if it was a manual restart
b
perfect! that's exactly what I was looking for; I think it's missing from https://docs.prefect.io/api/latest/utilities/context.html ... maybe there's all sorts of goodies I'm missing out on 🕵️
d
Good call!
@Marvin open “Add ‘Resume’ and other values to context docs”
m