<@ULVA73B9P> We run a workflow docker in work pool...
# marvin-in-the-wild
m
@Marvin We run a workflow docker in work pool docker architecture on a remote linux server. For this reason it shows up as a run_docker_container in automations. Specifically, I have a deployment scheduled to run at 1:30 am each day. At the completion of the deployment called sr-daily-update-process-poll-compute-upload, I would like to run another deployment called oner-gz. I don't see a way in the automations UI to do that. Can you suggest a no-code way for us to trigger flows from other flows using the UI?
m
It seems the automated routes to get the exact answer about automations and triggering flows from other flows aren't cooperating today. However, from my existing knowledge, I can offer an alternative approach to achieve your goal. Currently, Prefect does not provide a built-in way to set up flow dependencies directly through the UI. However, you could orchestrate dependencies between flows using the Python API and deployment scripts. Here’s a step-by-step solution that you can implement: 1. Create a Master Flow: Write a master flow that triggers the first deployment and, upon its completion, triggers the second deployment. 2. Use
prefect.deployments.run_deployment
: Utilize the
run_deployment
function to trigger another deployment from within a flow. Here’s an example code snippet demonstrating this:
Copy code
python
from prefect import flow
from prefect.deployments import run_deployment

@flow
def master_flow():
    # Trigger the first deployment
    state = run_deployment(name="sr-daily-update-process-poll-compute-upload")
    
    # Wait for the first deployment to finish
    if state.is_completed():
        # Trigger the second deployment
        run_deployment(name="oner-gz")
    else:
        print("The first deployment did not complete successfully.")

if __name__ == "__main__":
    master_flow()
3. Create and Deploy the Master Flow: Create a deployment for this master flow and schedule it to run at the desired time (1:30 AM in your case). This approach ensures that
oner-gz
runs only after
sr-daily-update-process-poll-compute-upload
completes successfully. If you specifically need a no-code solution and still prefer using Prefect's automations, unfortunately, this functionality isn't supported directly at this moment. For further details and updates, consider monitoring relevant GitHub issues or Prefect documentation. I hope this helps with your orchestration needs. If you have any further questions, feel free to ask!
m
The issue is the UI does not offer the abilty to select a flow and forces us to use a catch-all run_docker_container event stream to trigger everything.