{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "prefecthq-prefect--turn-a-python-script-into-an-observable-workflow",
 "repo": "PrefectHQ/prefect",
 "repo_url": "https://github.com/PrefectHQ/prefect",
 "repo_slug": "prefecthq-prefect",
 "title": "Turn a Python script into a tracked workflow",
 "page_title": "How to turn a Python script into a tracked workflow with Prefect",
 "summary": "Wrap functions with Prefect's flow and task decorators and watch every run in the local Prefect UI.",
 "who": "A developer whose cron scripts fail silently and leave no history.",
 "problem": "Plain scripts give no visibility into what ran, what failed and why.",
 "outcome": "A flow whose runs, tasks and logs show up in the Prefect UI at localhost:4200.",
 "steps": [
  "Install with `pip install -U prefect` or `uv add prefect` (Python 3.11+)",
  "Decorate your functions with task and the entry point with flow, as in the GitHub stars example",
  "Run the script once with Python to execute the flow",
  "Start the UI with `prefect server start` and open http://localhost:4200",
  "Add retries and caching to tasks that call flaky services"
 ],
 "agent_prompt": "Using PrefectHQ/prefect, convert <my script> into a flow with a task per step, add retries to the network calls, run it, and start `prefect server start` so I can see the run.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Beginner",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "This card is written from the PrefectHQ/prefect README, not from a test run by Deduped. Before you start, make sure you have Python 3.11 or later. Check the repo for newer instructions before you rely on these steps.",
 "category": "Data and analytics",
 "tags": [
  "Data and analytics"
 ],
 "lang": "python",
 "requirements": [
  "Python 3.11 or later",
  "pip or uv",
  "Optional: a Prefect Cloud account instead of a self-hosted server"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/prefecthq-prefect/turn-a-python-script-into-an-observable-workflow/",
 "md": "https://dedupedai.com/use-cases/prefecthq-prefect/turn-a-python-script-into-an-observable-workflow/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/prefecthq-prefect--turn-a-python-script-into-an-observable-workflow.json",
 "api_version": "v1"
}
