From 06d68ee998909c9202458292fda4fa424b7f1d4d Mon Sep 17 00:00:00 2001 From: Frikky Date: Mon, 25 Sep 2023 12:19:19 +0200 Subject: [PATCH] Fixed some failover issues with auth/exec id for subflows --- shuffle-subflow/1.0.0/src/app.py | 6 ++++++ shuffle-subflow/1.1.0/src/app.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/shuffle-subflow/1.0.0/src/app.py b/shuffle-subflow/1.0.0/src/app.py index 2fc46527..82253179 100644 --- a/shuffle-subflow/1.0.0/src/app.py +++ b/shuffle-subflow/1.0.0/src/app.py @@ -172,6 +172,12 @@ def run_subflow(self, user_apikey, workflow, argument, source_workflow="", sourc else: print("No startnode") + if len(self.full_execution["execution_id"]) > 0 and self.full_execution["execution_id"] != source_execution: + params["source_execution"] = self.full_execution["execution_id"] + + if len(self.full_execution["authorization"]) > 0 and self.full_execution["authorization"] != source_auth: + params["source_auth"] = self.full_execution["authorization"] + if len(str(backend_url)) > 0: url = "%s/api/v1/workflows/%s/execute" % (backend_url, workflow) print("[INFO] Changed URL to %s for this execution" % url) diff --git a/shuffle-subflow/1.1.0/src/app.py b/shuffle-subflow/1.1.0/src/app.py index f1fa452a..a02ae79e 100644 --- a/shuffle-subflow/1.1.0/src/app.py +++ b/shuffle-subflow/1.1.0/src/app.py @@ -174,6 +174,12 @@ def run_subflow(self, user_apikey, workflow, argument, source_workflow="", sourc else: print("No startnode") + if len(self.full_execution["execution_id"]) > 0 and self.full_execution["execution_id"] != source_execution: + params["source_execution"] = self.full_execution["execution_id"] + + if len(self.full_execution["authorization"]) > 0 and self.full_execution["authorization"] != source_auth: + params["source_auth"] = self.full_execution["authorization"] + if len(str(backend_url)) > 0: url = "%s/api/v1/workflows/%s/execute" % (backend_url, workflow) print("[INFO] Changed URL to %s for this execution" % url)