Can I duplicate workflow or nodes changing only some parameters

Hi everyone,

I manage different client environment and use n8n to automate some operations.

For each clients I duplicate nodes and change for each nodes a parameters in the node name and inside nodes (HTTP Requests and body and/or inside functions)

It takes a lot of time to do it for each workflow and for every nodes.

Do you have an idea to duplicate nodes and replace at once a single parameter (my name for example “Jeremy” to “Nicolas” each time my name exist in the nodes/workflow) ?

Here an example of a workflow. Each line of nodes correspond to one client. If I want to add a client I will have to copy and past and change every time I see the name of the previous inside a node into the new client name…

Hope I made myself clear !

Thank you for your help !

Do you have an idea to duplicate nodes and replace at once a single parameter (my name for example “Jeremy” to “Nicolas” each time my name exist in the nodes/workflow) ?

Hi @jeremydahan, if you have separate workflows per client, I think the easiest way would be to export your workflow, for example through our REST API. This should give you a JSON representation of your workflow in which you can perform a quick find & replace. Once done, remove the ID of the workflow (to avoid overwriting an existing workflow by accident), give it a new name and save it as a new workflow.

If you have everything in one workflow you can copy just the required nodes and update the existing workflow instead of creating a new one, though I think this will be a lot more work to implement.

On the actual use case I’d check if your can re-use your existing workflow for each client and then reference the changing data via expressions in your flow. Or is this not working for some reason?

2 Likes

Thank you very much for your answer, It is indeed a much faster solution to my issue !

1 Like

@MutedJam can you elaborate more on this please?

i have an n8n workflow that has

supabase api key
telegram api key

these need to be updated to new keys when I want to duplicate the n8n workflow.

What should the EXACT Post/Get request through the N8N Rest API be to “Duplicate” a workflow and “Update” those specific API keys?

Also what do you mean by using expression to change data as we duplicate workflows?

Would this mean like using “Set” and setting “API Key” as a variable and using “API Key” in later nodes (e.g. telegram, supabase)…?