How to distribute fixtures based on module within an app

In my situation, several developers working on same app are appending different workflow states & corresponding workflow for the document and all this is managed under fixtures directory for each app, developers working under different module have different versions working on due to which conflicts arise while rebasing the repo from upstream. For which I wish to have different fixtures folder for each module in an app.

1 Like

We are facing challenges managing fixtures in a multi-developer setup while working on complex Frappe apps.

Currently, we have a hooks.py that includes a large fixtures block covering Workflows, Workflow States, Property Setters, Roles, Assignment Rules, Formula Rules, etc. When we run bench export-fixtures, it exports everything into a single JSON per doctype under the fixtures/ folder.

The problems we’re running into:

  • Merge conflicts: Since all changes from multiple developers go into one big file, we constantly get conflicts during PR merges.
  • Missed updates: Developers sometimes forget to update hooks.py with new doctypes/filters, so fixtures don’t get exported consistently.
  • Name drift / inconsistencies: For example, the same doctype or workflow sometimes ends up with slightly different naming/spelling across fixtures (e.g., different capitalization, spacing, or duplicate entries). This leads to confusion and errors when applying fixtures, since Frappe treats them as separate records.
  • Scalability: With dozens of workflows and states, our hooks.py has become very hard to maintain.

Frappe allows only one fixtures folder per app, which means all exported workflows and workflow states end up in a single JSON file inside the fixtures directory. The fixtures configuration in hooks.py is a flat list, and there’s no built-in way to tell Frappe to maintain multiple fixture folders like fixtures/module_a/ and fixtures/module_b/.

Because of this, when multiple developers are working on different modules in the same app, conflicts are common during rebasing or merging since everyone is modifying the same workflow_state.json and workflow.json files.

If you want to organize fixtures by module, you’d need to handle it manually, for example:

  • Write a custom export script to export workflows for each module separately and move them into subfolders.
  • Use custom import logic during app installation to load fixtures from those module-specific folders.
  • Or, for larger projects, split independent modules into separate apps, which completely isolates their fixtures and avoids conflicts.

In short: multiple fixture folders are not supported out of the box, but you can implement a custom process to achieve similar organization.