Return from workflow on failure is now implemented. 😃
The individual workflows can implement error handling for themselves, or just punt the error up to the the next level.
This is combining with the lower level calls implementing retries at the protocol level, where it makes sense. I am doing it at this level because retrying is protocol specific, so it makes sense to have a policy to let the individual protocols implement their own unique policies.
I had to add this to every existing proc agent.
# if the status is a fail
if status['status']['value'] == 1: # Step failed
logging.info(f"{spacing}Step Failed. '{agent_name}' reason: {status['status']['reason']} ")
return_on_fail = workflow.get('return_on_fail', 0)
#and the workflow is marked return on fail
if return_on_fail == 1:
return b'', status
else: logging.info(f"{spacing}Step completed. '{agent_name}'")
results.update(status)
results['step_index'] = results['step_index'] +1
No comments:
Post a Comment