<@ULVA73B9P> like n8n or other soar tools they sho...
# marvin-ai
s
@Marvin like n8n or other soar tools they show the graph execution and input and output results Can this achieved in prefect for troubleshooting issues
m
thought for 213.1 seconds
Yes — Prefect 3.x gives you a live graph of your flow/task execution and lets you inspect what happened for troubleshooting. What you can see in the UI: - Graph/DAG view of each flow run with live state updates and timing - Click any node to see state history, logs, retries, duration - Parameters at the flow level - Task inputs and outputs (outputs require result persistence) - Rich “Artifacts” (tables, markdown, links, images, progress) associated with a flow/task run How to see inputs/outputs - Inputs: Click a task run in the graph; inputs are shown in the task run details. - Outputs: Persist results so the UI can fetch and display them. Enable result persistence - Per-task/flow:
Copy code
from prefect import flow, task

@task(persist_result=True)
def transform(x):
    return {"y": x + 1}

@flow(persist_result=True)
def my_flow(a: int):
    return transform(a)
- Globally (verified CLI):
Copy code
prefect config set PREFECT_RESULTS_PERSIST_BY_DEFAULT=true
- Optional: configure where results are stored (e.g., S3, local block):
Copy code
@flow(result_storage="s3-bucket/my-bucket")
def my_flow(a: int): ...
Docs: Persisting results Use Artifacts to display human-friendly outputs - Add tables/markdown/progress to runs for quick inspection:
Copy code
from prefect import task
from prefect.artifacts import create_markdown_artifact, create_table_artifact

@task
def report():
    create_markdown_artifact(
        key="summary",
        markdown="# Run Summary\nEverything looks good ✅",
        description="High-level summary"
    )
    create_table_artifact(
        key="top-customers",
        table=[{"customer_id": 1, "score": 98}, {"customer_id": 2, "score": 95}],
        description="Top customers"
    )
Docs: Artifacts overview and How to create artifacts Static DAG during development - To preview structure before running:
Copy code
from prefect import flow, task

@task
def a(): return 1

@task
def b(x): return x + 1

@flow
def pipe():
    return b(a())

pipe.visualize()  # requires Graphviz
Docs: Visualize workflow structure Reference for the flow run graph (if you’re curious about the API powering the UI) - Flow run graph API Would you like help turning on result persistence in your project or adding artifacts to your runs? Also, are you on Prefect Cloud or the open-source UI?