I’m running one flow, inside the flow there are 4,5 task, I’m mark the task as success using graphql based on task id, inside the task one while loop is running, after marking/changing state success, still inner while loop is running, till condition is satisfied & due to that next task is not able to initiate.
Also passing the result to task with change state, not able to receive the result into task.
Thanks for sharing your code. I’d love to help, but I struggle to understand what end goal you have in mind. Do you try to have some never-ending flow using this while loop in your task, and you try to stop this never-ending loop by setting the state to Success?
Could you explain your use case a bit more? Is this some sort of real-time streaming use case or polling for some file to arrive?
End goal for this workflow execute the task in interval and mark that task as success if task is completed before time or reschedule the task with new datetime, for that we are checking with while loop to reach that timeout.
if we mark the task as success, while loop continues run, its doesn’t stop it, that’s why it’s not jumping to next task.
Yes, we are trying to stop the flow by marking it success.
What is the success meaning, it will not stop the internal running loop (like while loop) ?
What is solution for it ?
Few more issue are coming,
3. We are trying to run simple task using client with key and schedule datetime, its appearing duplicate in prefect cloud console, one with schedule time and one immediate.
4. If we try to reschedule with new datetime, this also not working, only states are getting update
5. Can’t we reschedule the same flow ?
Please ans the above question.
Sort simple : Run flow (Working, Sometime not working normal schedule also)-> Schedule / Re-schedule with new date time(Not working) → setFlowRunState(Working , but not working in case of schedule with new datetime, i have used with “Schedule()”)
Sort of: you could start a new flow run, or when you are on Prefect Cloud, you could trigger a new flow run based on Automation SLA, e.g. if your flow run takes too long to start or complete. Example:
Reply to : We are trying to run simple task using client with key and schedule datetime, its appearing duplicate in prefect cloud console, one with schedule time and one immediate.
schedule_2 = Schedule(
clocks=[DatesClock([pendulum.now().add(minutes=5)])]
)
# schedule = IntervalSchedule(interval=timedelta(minutes=2))
@task
def check_schedule():
print("success")
with Flow("gaurav",schedule=schedule_2) as flow_2:
check_schedule()
flow_2.register(project_name="amoga",idempotency_key=flow_2.serialized_hash())
Manual state change to success but still the inner task is in pending state What do you mean by state change ??? is it only of make colour change or any implementation is there
related to it
It looks like some of your flows are stuck in a Scheduled state, causing Late runs. This usually happens due to a label mismatch between your flow run config and your agent. This topic explains how to solve it: