How to programatically convert nodes from draft to saved Is there a way I can convert all my imported nodes into "saved " status instead of "Draft" programmatically? Can this be done in a hook and what would the code for doing this be? If it can be done with Rules how exactly would this rule be created?  This has to be something that is done without any user interaction, so Views Bulk operations is not the answer.

I am using workflow module, and it has two states, the first one is draft, the second one is "Done"

Thanks,
You can change Workflow status for all nodes using Views Bulk Operations module
Here is a little manual how to accomplish this task:


Download and install Views Bulk Operations module
Create a view that will show content of necessary content type in table format.





Add in this view next fields: Content: Title, Workflow history: New state name, Workflow history: Old state name and Bulk operations: Content.





Open created view page, select all nodes, choose "Change workflow state of post to new state" operation and click on the "Execute" button





Choose new node state and click on the "Next" button





On the next page press on the "Confirm" button