Automatically saving workflows can result in overwriting changes made by others #3610
Replies: 1 comment
-
To address the issue of automatic workflow saves overwriting changes made by others, implementing version control is a practical solution. Here's a strategy to integrate version control into your workflow management:
Here's a basic example to start implementing these concepts: const publishWorkflow = async (endpoint: string) => {
const newVersionData = { ...workflowData, version: getNextVersion() };
const response = await fetch(endpoint, {
method: 'POST',
body: JSON.stringify(newVersionData),
headers: {
'Content-Type': 'application/json',
},
});
if (!response.ok) {
throw new Error('Failed to publish new version');
}
return await response.json();
};
const getNextVersion = () => {
return latestVersion + 1; // Simplified example, assumes tracking of the latest version
};
const checkIfLatestVersion = async () => {
// Logic to fetch the latest version and compare with the current version
}; This approach ensures that each change creates a new version, preventing overwrites and facilitating clearer version management. Sources
|
Beta Was this translation helpful? Give feedback.
-
Self Checks
Dify version
latest
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
When developing a workflow together or forgetting to close the browser tab, the old configuration will be automatically saved, overwriting unpublished content from others
✔️ Expected Behavior
There should be a concept of version, where everyone can create a new version when making changes. It is prohibited to make changes to the old version, otherwise the same configuration can be easily overwritten. It should be clear which version the exposed interface references
❌ Actual Behavior
override the same configuration
Beta Was this translation helpful? Give feedback.
All reactions