Hi, I am trying to get the execution params to ret...
# ask-the-community
n
Hi, I am trying to get the execution params to retrieve the URL like so -
current_context().ExecutionParameters().execution_id.url
for this I am getting an EXECUTIONPARAMS not available in current context error. I also tried current_context().execution.parameters.execution_id.url I get the same error but for EXECUTION. I am doing this in a task and according to the docs ExecutionParams object is available to all tasks. Am I missing something? Is there any other way to get the execution URL in the code? Error verbatim : EXECUTION not available as a parameter in Flyte context - are you in right task-type?
j
we have been doing it this way
Copy code
ctx = FlyteContext.current_context()
    workflow_execution_id: WorkflowExecutionIdentifier = (
        ctx.user_space_params.execution_id
    )
So this will return the execution_id and we construct the URL from it since base url is predefined already
n
We are planning to have two deployments so there will be 2 urls, we need the full URL so we don't need to worry about the base URL.
j
i see, yeah we also have multiple deployments, they are just being set during registration with env variables.