add organization_id filter for get_workflow and get_workflow_run (#1422)

This commit is contained in:
Shuchang Zheng 2024-12-22 17:49:33 -08:00 committed by GitHub
parent b256bace6a
commit 2e37542218
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 44 additions and 18 deletions

View file

@ -351,8 +351,14 @@ class BaseTaskBlock(Block):
# initial value for will_retry is True, so that the loop runs at least once
will_retry = True
current_running_task: Task | None = None
workflow_run = await app.WORKFLOW_SERVICE.get_workflow_run(workflow_run_id=workflow_run_id)
workflow = await app.WORKFLOW_SERVICE.get_workflow(workflow_id=workflow_run.workflow_id)
workflow_run = await app.WORKFLOW_SERVICE.get_workflow_run(
workflow_run_id=workflow_run_id,
organization_id=organization_id,
)
workflow = await app.WORKFLOW_SERVICE.get_workflow(
workflow_id=workflow_run.workflow_id,
organization_id=organization_id,
)
# if the task url is parameterized, we need to get the value from the workflow run context
if self.url and workflow_run_context.has_parameter(self.url) and workflow_run_context.has_value(self.url):
task_url_parameter_value = workflow_run_context.get_value(self.url)