SaveWorkflowAndShutdown:
The SaveWorkflowAndShutdown node is designed to streamline your workflow management by automatically saving your current workflow and initiating a system shutdown. This node is particularly beneficial for users who want to ensure their work is saved before shutting down their system, thus preventing data loss. It offers flexibility in how workflows are saved, allowing you to either overwrite existing files or save them as new, timestamped files. The node also provides a delay feature, giving you time to cancel the shutdown if needed. By integrating this node into your workflow, you can automate the process of saving and shutting down, ensuring a seamless and efficient workflow management experience.
SaveWorkflowAndShutdown Input Parameters:
enabled
This parameter determines whether the node is active. When set to True, the node will execute its functions; if False, it will abort the operation. This allows you to control when the node should be operational. The default value is False.
delay_seconds
This parameter specifies the delay in seconds before the system shutdown is initiated. It provides a buffer period during which you can cancel the shutdown if necessary. The default value is 60 seconds.
save_workflow
This parameter indicates whether the current workflow should be saved before shutdown. When set to True, the workflow will be saved according to the specified save mode. The default value is True.
save_mode
This parameter defines how the workflow should be saved. Options include "Overwrite Existing File" and "Save as New Timestamped File." The choice affects whether the workflow overwrites an existing file or is saved as a new file with a timestamp. The default option is "Save as New Timestamped File."
filename_prefix
This parameter sets the prefix for the filename when saving the workflow. It is used in conjunction with the save mode to determine the final filename. The default value is 'workflow_autosave.json'.
SaveWorkflowAndShutdown Output Parameters:
ui
This output parameter provides a dictionary containing the current settings of the node, such as whether it is enabled, the delay time, and save options. It is useful for verifying the node's configuration.
result
This output parameter returns a tuple containing the trigger status and a status message. The status message indicates whether the shutdown is proceeding or if there are remaining tasks in the queue.
SaveWorkflowAndShutdown Usage Tips:
- Ensure that the
enabledparameter is set toTruewhen you want the node to execute its functions, otherwise, it will not perform any actions. - Use the
delay_secondsparameter to provide yourself with enough time to cancel the shutdown if you change your mind. - Choose the appropriate
save_modebased on whether you want to overwrite an existing workflow file or save a new version with a timestamp. - Regularly check the
uioutput to confirm that the node's settings are configured as intended.
SaveWorkflowAndShutdown Common Errors and Solutions:
"Save & Shutdown API: Triggered, but node is disabled. Aborting."
- Explanation: This error occurs when the node is triggered, but the
enabledparameter is set toFalse. - Solution: Set the
enabledparameter toTrueto allow the node to execute its functions.
"Save & Shutdown API: ERROR! Failed to save workflow: <error_message>"
- Explanation: This error indicates that there was an issue saving the workflow, possibly due to file permission issues or an invalid file path.
- Solution: Check the file path and permissions to ensure the node has the necessary access to save the file.
"Save & Shutdown API: Shutdown already in progress."
- Explanation: This message appears when a shutdown process has already been initiated, preventing a new one from starting.
- Solution: Wait for the current shutdown process to complete before attempting to trigger another one.
"Save & Shutdown API: Triggered, but <remaining_tasks> items still in queue. Shutdown aborted."
- Explanation: This error occurs when there are still tasks remaining in the queue, preventing the shutdown from proceeding.
- Solution: Allow the remaining tasks to complete before triggering the shutdown again.
