Zammad User Role Batch Update Automation - n8n Workflow

Use this robust n8n workflow to automatically synchronize and reset Zammad user roles to standard defaults. This n8n template ensures compliance and simplifies maintenance tasks.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Zammad Administrators requiring compliance enforcement.

  • IT Operations teams needing to standardize user permissions.

  • Users looking for an example of effective batch API updates using n8n.

  • Technical users seeking advanced n8n templates for maintenance scripting.

Overview

Maintaining consistent user permissions across a large Zammad instance can be challenging. This n8n workflow provides a robust automation solution for auditing and enforcing default role assignments. By utilizing this powerful n8n workflow, administrators can ensure that all active users are correctly assigned baseline roles, streamlining IT compliance and reducing manual administrative load. The architecture is flexible, allowing you to easily define which users must be excluded from the bulk update process and which roles are considered the standardized defaults. This specific n8n template also includes an optional branch to retrieve and export current Zammad roles for auditing purposes.

How it Works

This automation is initiated using a simple manual n8n trigger, designed for scheduled maintenance runs or immediate batch operations.


  1. Configuration: The process starts at the Basic Variables n8n node, where essential data like the Zammad API key, base URL, a list of defaultroles (Role IDs), and an excludezammadusersbyid list are defined.

  2. Data Retrieval: Two parallel paths execute: the Get all Roles path retrieves all defined Zammad roles (and optionally exports them to Excel), and the Get all Users Zammad n8n node retrieves the full list of users.

  3. User Filtering: Each retrieved user item passes to the If n8n node, which applies critical filtering logic. It only proceeds if the user is currently active AND the user's ID is NOT present in the exclusion list defined in the initial Basic Variables n8n node.

  4. Role Assignment: For every user who passes the filter, the final Update Users to default Role(s) n8n node executes. This n8n node sends a PUT request to the Zammad API using dynamic expressions to target the specific user ID and assign the array of defaultroles defined earlier. The workflow is configured with error handling to continue processing other users even if one specific API call fails.

Installation Guide

To utilize this n8n template effectively, follow these steps:


  1. Import: Copy the provided JSON data and import it directly into your self-hosted or cloud n8n instance.

  2. Credentials: The workflow requires credentials for the Zammad n8n node (Get all Users). Set up a 'Zammad Token Auth' credential using an administrator API token.

  3. Configure Variables: Open the Basic Variables Set n8n node and update the following placeholders:

zammadbaseurl: Replace -put-your-zammad-base-url-.
zammadapikey: Replace -put-your-api-key- (Note: Although credentials are set for the Zammad node, this custom API key is required for the HTTP Request n8n node used for the update).
defaultroles: Input the comma-separated IDs (e.g., [2, 3]) of the roles you want to enforce.
exclude
zammadusersby_id: Input the comma-separated IDs of users who should retain their current roles and be skipped by the n8n workflow.

  1. Testing: Activate the n8n workflow and click the ‘Test workflow’ n8n trigger to execute the batch update.

Node Details

When clicking ‘Test workflow’ (Manual Trigger): Serves as the starting point, initiating this batch n8n workflow when manually activated.
Basic Variables (Set n8n node): Central configuration hub. Defines the API URL, authentication key, array of defaultroles to assign, and an array of user IDs (excludezammadusersby_id) to skip during the process.
Get all Users (Zammad n8n node): Connects to Zammad to fetch a list of all current users. Crucial for feeding the user data into the rest of the n8n workflow.
If (Logic n8n node): Acts as the gatekeeper. It ensures that the user is currently active (active: true) and that their User ID is not present in the exclusion list defined in the Basic Variables n8n node.


  • Update Users to default Role(s) (HTTP Request n8n node): The final action. This n8n node executes a PUT request to the Zammad API to overwrite the user's existing roles with the list of default roles. It uses the continueErrorOutput setting for reliable batch processing.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by
Sirhexalot
Sirhexalot

Open source enthusiast and Zammad user with a passion for sharing knowledge and building simple, effective automation solutions with n8n.

Featured*