How can i export and import workflows

How can i export and import workflows?

You can include Workflow State and Workflow Action in hooks.py of your custom app and migrate them as fixtures.

1 Like

Hi @Sintayehu_shibeshi,

Adding @Pawan answer,

please apply in hook.

fixtures = [{
                "doctype": "Workflow"
        },
			{
				"doctype": "Workflow State"
			}
	]

After then export for an apply command like:

bench export-fixtures

//OR

bench --site yourSite export-fixtures

Thank You!

1 Like

Workflows themselves don’t really have any functionality that would support data import/export, they are simply triggered based and can perform conditional tasks like updating records, sending email notifications etc.

custom software development firm - https://thescimus.com

Hello,
Dont’ we need workflow action as well?

Hi @Abhiraj_Tulsyan,

Then you can add it in hook.py

fixtures = [{
                "doctype": "Workflow"
        },
			{
				"doctype": "Workflow State"
			},
			{
				"doctype": "Workflow Action"
			}
	]

After then export for an apply command like:

bench export-fixtures

//OR

bench --site yourSite export-fixtures

Thank You!

1 Like