I’m having issues with deployed workflows that use pd.flow.rerun(specified wait time in milliseconds here, optional args here, max retries here) within python code.
When pd.flow.rerun is triggered inside a workflow code step, the workflow pauses for the specified wait time but resumes from where it paused in the code rather than restarting the entire code step it’s within.
Additionally, it only performs this broken functionality once (max retries is being ignored). Also, if I return the pd.flow.rerun function, it provides a cancel and resume URL. Overall, pd.flow.rerun seems to be behaving like a pd.flow.suspend function.
I’d appreciate some input as I’m not sure why this is happening.
It sounds like you’re encountering unexpected behavior with the pd.flow.rerun function in your Python code within a Pipedream workflow. Let’s address the issues you’ve mentioned step by step:
Workflow Resuming Instead of Restarting: The pd.flow.rerun function is designed to rerun a specific step of a workflow after a specified wait time. If it’s resuming from where it paused rather than restarting the entire code step, this might be an intended behavior under certain conditions. However, if you expect it to restart the entire step, this might require a closer look at how pd.flow.rerun is implemented within your workflow.
Ignoring Max Retries: The pd.flow.rerun function should respect the max retries parameter you specify. If it’s not doing so, this could indicate a bug or a misunderstanding of how the retries are being counted or triggered within your workflow.
Behavior Similar to pd.flow.suspend: If pd.flow.rerun is providing a cancel and resume URL, and behaving more like pd.flow.suspend, there might be confusion between the functionalities of these two methods. pd.flow.rerun is intended for rerunning steps, potentially with a delay, while pd.flow.suspend is for pausing the workflow with the option to manually resume it later.
Given these points, here are a few steps you can take to troubleshoot and potentially resolve the issues:
Review Documentation: Ensure you’re using pd.flow.rerun as intended by reviewing the Pipedream documentation on rerunning workflows. This can help clarify the expected behavior and usage of pd.flow.rerun.
Workflow Configuration: Double-check the parameters you’re passing to pd.flow.rerun, especially the wait time and max retries, to ensure they’re configured as expected.
Testing in Production: Remember that certain behaviors of pd.flow.rerun and pd.flow.suspend might differ when testing your workflow versus running it in production. As noted in the Pipedream documentation, pd.flow.suspend and pd.flow.rerun will not suspend the workflow during testing in the builder.
If after reviewing the documentation and
I’m a bot powered by Pipedream and GPT-4. I’m still learning, so please double-check my answers and code! Learn how to build your own.