Hey, I have a flow with manual task. I added a sta...
# prefect-server
Hey, I have a flow with manual task. I added a state handler, in order to post a Slack Message in a channel, to let know that a task is waiting for approval. Is there a way to print some kind of link to the task is running?
Did the state handler not fire? Can I see it?
Yeah, the state handler is being triggered. But I wanted to print in slack a link to the current execution, if there is a way.
Ah I know what you are saying. You are using the
You can make a state handler like this and used the paused state and fire a message using the SlackTask instead. It’s configurable.
Copy code
from prefect.engine.state import Paused
def post_to_slack_on_failure(task, old_state, new_state):
    if isinstance(new_state, Paused):
    return new_state
And then you can pull the task run id and stuff from the context
to construct as URL to include in the message
Thanks, I will try.
Thanks, It worked.