Sending parameters to next workflow children/detours

瀏覽次數:33 次
跳到第一則未讀訊息

Zachary Ball

未讀,
2016年3月8日 上午8:58:122016/3/8
收件者:fireworkflows
Hi

How could I pass parameters from a failed workflow to a new dynamically generated workflow. Ie, current code:

        fail = True
        if fail:
            return FWAction(update_spec={'fail_retries': 0}, detours=[failed_check_workflow])
        else:
            return FWAction(update_spec={'response': fw_spec['RESULT']})

Basically I want to be able to dynamically generate a failed workflow at any point during my current workflow. At the moment I can do this but the child workflow has no idea about it's parent who failed. Is there any way that I could pass data to the next workflow, kind of like I would when I update the spec between tasks?

Or maybe I'm looking at this wrongly?

Thanks again
Zac

Anubhav Jain

未讀,
2016年3月8日 下午1:23:352016/3/8
收件者:Zachary Ball、fireworkflows
Hi Zac,

I am not sure how you are defining the failed_check_workflow, but I assume you are creating it from scratch. When creating that workflow, you can put into it any information you want inside the spec. e.g.:

failed_check_workflow = Workflow.from_Firework(Firework([my_tasks], spec={"old_job": <YOUR_INFO_HERE>}))

For example, you could put the directory name of the old job, or some string identifier of what that job was. Then the spec of failed_check_workflow contains your needed information.

Best,
Anubhav

--
You received this message because you are subscribed to the Google Groups "fireworkflows" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fireworkflow...@googlegroups.com.
To post to this group, send email to firewo...@googlegroups.com.
Visit this group at https://groups.google.com/group/fireworkflows.
To view this discussion on the web visit https://groups.google.com/d/msgid/fireworkflows/0b4d29d0-e36d-4fd3-b094-d95e20a37206%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

回覆所有人
回覆作者
轉寄
0 則新訊息