Prefect task pause to resume state to running state

I want to resume a task from Pause state to Resume state or Running state but its not working

import prefect
from prefect import task, Flow
from prefect.triggers import manual_only
from prefect.engine import signals

def build():
    logger = prefect.context.get("logger")"build task")
    print("build task")
    return True

def test(build_result):
    logger = prefect.context.get("logger")"test task")
    print("test task")

def deploy():
    logger = prefect.context.get("logger")"deploy for pause resume task")
    """With the manual_only trigger this task will only run after it has been approved"""
    print("deploy task")
with Flow("code_deploy") as flow:

# has been commented out to register and run the flow with Prefect Cloud
# use to run and test the flow locally
# the manual only trigger will prompt to resume the task in the command line

# Registers the flow with a project named pause_resume
flow_id = flow.register("tester")

# # flow.run_agent()
# print(flow_id)

But resume is not working,
Simple please let me know the best/simple way to resume a task, no where of docs mention how to resume a task.

1 Like

I believe what is missing is setting dependencies between tasks, can you try this?

with Flow("code_deploy") as flow:
    t1 = build()
    t2 = test(True, upstream_tasks=[t1])

Regarding docs, check those resources: