This message was deleted.
# ask-ai
e
This message was deleted.
j
You can specify a custom execution name when launching a workflow using the
--execution-name
(or
-n
) flag with the
pyflyte run
command. This allows you to set a human-readable name for the workflow execution instead of the default randomly generated execution ID. For example:
Copy code
pyflyte run --remote -n my_custom_name example.py wf --name Ada
According to the pyflyte CLI documentation, the
-n, --execution-name <execution_name>
option lets you create a named execution, which can help with tracking and prevents launching multiple executions with the same name. Would you like more detail on how this works or how to view named executions in the Flyte UI? Sources: - pyflyte CLI documentation ๐Ÿ‘ 0 button ๐Ÿ‘Ž 0 button ๐Ÿ’ก Hint: Mention @runllm in the thread for followups.
a
how to trigger workflow using flyte api? @ancient-wolf-19325
j
You can trigger a workflow execution using the Flyte API by calling the FlyteAdmin "launch execution" endpoint, or programmatically via the FlyteRemote Python API. With FlyteRemote, you fetch the workflow or launch plan and then call
remote.execute(...)
with the desired inputs. Example:
Copy code
from flytekit.remote import FlyteRemote
from flytekit.configuration import Config

remote = FlyteRemote(
    config=Config.for_endpoint(endpoint="flyte.example.net"),
    default_project="flytesnacks",
    default_domain="development",
)
workflow = remote.fetch_workflow(name="workflows.example.wf", version="v1")
execution = remote.execute(workflow, inputs={"mean": 1}, execution_name="workflow-execution", wait=True)
For direct HTTP API usage, you must interact with the FlyteAdmin API, but the official documentation does not provide explicit HTTP+JSON examplesโ€”only that it is possible via the FlyteAdmin endpoints. See the linked resources for more details. Would you like more detail on using the HTTP API or on monitoring executions? Sources: - FlyteRemote workflow execution example - FlyteAdmin API HTTP example discussion ๐Ÿ‘ 0 button ๐Ÿ‘Ž 0 button ๐Ÿ’ก Hint: Mention @runllm in the thread for followups.
a
If any task fails how to get that output/status of that task? @ancient-wolf-19325
j
You can inspect the status and outputs (including errors) of a failed task by viewing the workflow execution in the Flyte UI, which shows each node's status and error details. Programmatically, you can use FlyteRemote to fetch the execution, sync it, and then access the
node_executions
dictionary to check each node's phase and error message. For example:
Copy code
from flytekit.remote import FlyteRemote
remote = FlyteRemote(...)
execution = remote.fetch_execution(name="exec_id", project="my_project", domain="development")
synced_execution = remote.sync(execution, sync_nodes=True)
for node_id, node_exec in synced_execution.node_executions.items():
    print(node_id, node_exec.closure.phase, getattr(node_exec.closure, "error", None))
According to the FlyteRemote documentation and Flyte UI docs, this approach allows you to programmatically or visually inspect the status and error details of each task in a workflow execution. Would you like more detail on error handling or retrieving logs for failed tasks? Sources: - FlyteRemote remote-examples - Inspecting workflows in the UI ๐Ÿ‘ 0 button ๐Ÿ‘Ž 0 button ๐Ÿ’ก Hint: Mention @runllm in the thread for followups.