Export/Import a workflow

I know it's possible to export and import a workflow.

You guys can pass code example of how to export and import workflows for files?

thank you

if you have a TWorkflowDefinition variable named wdef, you can export this way:


wdef.Diagram.ExportAsBmp('C:\test.bmp');
Sorry, I was not specific about what I need.

Imagine the following situation: I have a consultant who develops a customized flow in the system, but using a local database.

Gotta catch this workflow and put in the database from my client. As I understand it, is only export the registry table [wsworkflowdefinition], using for example a tclientdataset.saveToFile and then export it to the customer's bank.

I think it will do what it takes, however long a problem: If there is a block in the workflow "Run Workflow" I would have to export another workflow as well.

Exist something ready for this? if not exist, how do you think I should do?

thank you 

There is no built-in feature that exports an workflow and its dependencies. If your workflow runs a sub-workflow, you will have to 
manually export both.