When does the `updatedAt` field gets updated?

Describe the question

I’m creating a workflow to backup all workflows and I would like to use the updatedAt field to determine if the workflow was changed and the backup needs to be updated.

For some workflows this works, but in some workflows this filed are regularly changed (on each run?).
My guess is, that this is the case for workflows which uses static data. Even if nothing was changed.

Is there a way to avoid that?

I could live with updates if the static data is changed, but it would be good to leave this field unchanged if nothing has changed.

This will change if you use staticData. If you’re not using it explicitly it’s quite possible that triggers in your workflow are updating staticData to track things like active webhooks etc.

I have a backup workflow that uses the new compare datasets node which deals with this exact issue. I’ll update the thread when I publish it.

1 Like

Thanks for your hint of the Compare node. Didn’t know that before.

I’ve tried that in combination with the To Binary and To JSON nodes, but somehow the JS code disappeared from the results (maybe a bug with the node).

So I gave up on comparing the workflows. :frowning_face:

Since I use Google Drive for the backup and n8n does not provide a way to update the files (Google Drive file update), I’m just reuploading everything.
After that I use a cleanup job to delete all files older a week.

Interesting, I didn’t know you couldn’t update files with GDrive.

I’d recommended using git in the form of Gitlab or GitHub. File updates work, and even better you get a full tracked history of all changes in a really nice diff view.

1 Like

Google Drive also has versioning, but only if the file is updated.
If the OAuth connection is used, there would be a way to do that directly via API. But since I’m using a Service Account I have to live with the workaround for now.

When there is a proper way to find out if the workflow has changed, I’ll think about switching to git. :smiley:

1 Like