Skip to content

Auto-Save & Drafts

FlowDrop automatically saves drafts of the current workflow to localStorage, preventing data loss when the browser closes unexpectedly.

  1. When autoSaveDraft is enabled (default: true), FlowDrop saves the current workflow to localStorage periodically
  2. The save interval defaults to 30 seconds (autoSaveDraftInterval: 30000)
  3. Drafts are keyed by workflow ID
  4. When a workflow is loaded, FlowDrop checks for a matching draft and offers to restore it
  5. After a successful save to the backend, the draft is cleared
const app = await mountFlowDropApp(container, {
features: {
autoSaveDraft: true, // default: true
autoSaveDraftInterval: 30000 // default: 30000ms (30 seconds)
},
// Optional: custom storage key prefix
draftStorageKey: 'my-app-flowdrop-draft'
});
features: {
autoSaveDraft: false;
}

For critical workflows, save more frequently:

features: {
autoSaveDraft: true,
autoSaveDraftInterval: 10000 // every 10 seconds
}

Use the onBeforeUnmount event to save a final draft when the editor is destroyed:

eventHandlers: {
onBeforeUnmount: (workflow, isDirty) => {
if (isDirty) {
localStorage.setItem(`flowdrop-draft-${workflow.id}`, JSON.stringify(workflow));
}
};
}

Browsers typically limit localStorage to 5-10MB. Large workflows with many nodes and complex configurations could approach this limit.

If storage is full:

  • The draft save fails silently
  • The editor continues working normally
  • No data is lost from the active session

A typical save flow:

eventHandlers: {
onDirtyStateChange: (isDirty) => {
// Show/hide "unsaved changes" indicator
indicator.style.display = isDirty ? 'block' : 'none';
},
onAfterSave: async (workflow) => {
// Draft is automatically cleared after successful save
showToast('Saved!');
},
onSaveError: async (error, workflow) => {
// Draft is preserved — user can retry
showToast('Save failed. Your changes are still saved locally.');
}
}