How to Dump Workflows

Version: 3.2
Edit this page

Warning: You are browsing the documentation for Symfony 3.2, which is no longer maintained.

Read the updated version of this page for Symfony 6.0 (the current stable version).

How to Dump Workflows

To help you debug your workflows, you can dump a representation of your workflow with the use of a DumperInterface. Use the GraphvizDumper to create a PNG image of the workflow defined above:

1
2
3
// dump-graph.php
$dumper = new GraphvizDumper();
echo $dumper->dump($definition);
1
$ php dump-graph.php | dot -Tpng -o graph.png

The result will look like this:

If you have configured your workflow with the Symfony framework, you may dump the dot file with the WorkflowDumpCommand:

1
$ php bin/console workflow:dump name | dot -Tpng -o graph.png

Note

The dot command is part of Graphviz. You can download it and read more about it on Graphviz.org.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.