This is a crucial topic for anyone doing serious development on Frappe. Here are a title and description optimized for a YouTube tutorial:YouTube Title & Description🎥 Title OptionsChoose one that fits your style (Tutorial, Guide, or Quick Tip):StyleTitleTutorialFrappe Workflows to Code! (The Right Way) - Using bench export-fixtures for WorkflowsDeploymentHow to Move Frappe Workflows from UI to Production (The Fixtures Method)Best PracticeSTOP Rebuilding Workflows! Export UI Changes to Code in Frappe / ERPNext📝 DescriptionUse this comprehensive description to cover all the key points, including the specific DocTypes needed.In this essential Frappe Framework tutorial, we show you the best practice for moving Workflows you create using the standard Frappe/ERPNext UI into your custom application's code base. This process is crucial for proper version control, deployment, and ensuring your customizations are safe across different environments (Development, Staging, and Production).You'll learn how to use the bench export-fixtures command to convert your UI configurations into JSON files that live in your custom app's file system, ready for Git.Key Topics Covered:The Problem: Workflows created in the UI are stored in the database, making them hard to deploy.The Solution: Using fixtures to export the database records to your app's file system.hooks.py Setup: Which specific DocTypes you need to include in your fixtures list for a complete Workflow export:WorkflowWorkflow StateWorkflow Action (if applicable)The Command: How to run bench --site [site-name] export-fixtures correctly.Deployment: The generated JSON files are automatically imported to your production site when you run bench migrate.Code Snippet for hooks.py:Python# [your_custom_app]/hooks.py
fixtures = [
{"doctype": "Workflow", "filters": [["name", "in", ("Quotation Approval Workflow")]]},
"Workflow State", # Or use filters for specific states
"Workflow Action" # Or use filters for specific actions
]
Don't manually recreate your workflows every time you deploy! Master the fixtures method and streamline your Frappe development process.#FrappeFramework #ERPNext #BenchCommands #Workflow #Fixtures #FrappeDevelopment #DeploymentGuide