Programatically saving current owrkflow

Hi Team,

I have a requirement that as part of my custom node execution, I need to save the current workflow and then export it as .knwf file.

Can I use the code in SaveWorkflowNodeModel::execute() method in my node to save the current workflow?
And is there an API to export the current workflow (as knwf) in which my node is?

Thanks
Ravikiran

1 Like

Hi @ravikiran,

have looked at the integrated deployment nodes? They might already solve your problem:
https://www.knime.com/integrated-deployment

best,
Gabriel

PS: To learn how to export workflows programatically, take a look at the WorkflowExportWizard class: https://github.com/knime/knime-workbench/blob/master/org.knime.workbench.explorer.view/src/org/knime/workbench/explorer/view/actions/export/WorkflowExportWizard.java

2 Likes

Thanks for the pointers Gabriel. I will take a look and get back to you if I need help.

Hi @ravikiran,

Also take a look at this node:

best,
Gabriel

Hi Gabriel,

Can I use the code in SaveWorkflowNodeModel::execute() method in my node to save the current workflow?

Yes, exactly this is what I have mentioned in my initial update too. Thanks for the confirmation.

Ravikiran