---
title: Recipes & Patterns
slug: recipes-and-patterns
createdAt: 2025-10-29T21:30:39.954Z
---

# HR to User Lifecycle Connector

**Goal:** Synchronise an HR feed into Activate to automatically create, move, and disable users.

:::BlockQuote
\<workflow>
&#x20; \<clearImport />
&#x20; \<import>
&#x20;   \<provider>Innovation.Activate.Library\Innovation.Activate.Connectors.ImportSql\</provider>
&#x20;   \<connectionString>Server=SQL01;Integrated Security=true;Initial Catalog=HRDB;\</connectionString>
&#x20;   \<sql>EXEC dbo.GetActiveEmployees\</sql>
&#x20; \</import>
&#x20; \<processImport />
&#x20; \<process>
&#x20;   \<provider>Innovation.Activate.Library\Innovation.Activate.Connectors.UserChangeHandler\</provider>
&#x20;   \<user>
&#x20;     \<link name="User Account">
&#x20;       \<scope>=//Roles/System Roles/Users\</scope>
&#x20;       \<match when="employeeNumber">(employeeNumber=%=//Current/employeeNumber%)\</match>
&#x20;     \</link>
&#x20;     \<enabled>=/isActive\</enabled>
&#x20;   \</user>
&#x20;   \<events>
&#x20;     \<create>
&#x20;       \<submit>
&#x20;         \<task>=//Tasks/User/Create User\</task>
&#x20;         \<arguments>
&#x20;           \<user>
&#x20;             \<firstName>%=//Current/firstName%\</firstName>
&#x20;             \<lastName>%=//Current/lastName%\</lastName>
&#x20;             \<email>%=//Current/email%\</email>
&#x20;           \</user>
&#x20;         \</arguments>
&#x20;       \</submit>
&#x20;     \</create>
&#x20;     \<delete>
&#x20;       \<submit>
&#x20;         \<task>=//Tasks/User/Disable User\</task>
&#x20;         \<arguments>
&#x20;           \<user>=//User\</user>
&#x20;         \</arguments>
&#x20;       \</submit>
&#x20;     \</delete>
&#x20;   \</events>
&#x20; \</process>
\</workflow>
:::

# Department Hierarchy to Role Tree

**Goal:** Build a complete Activate Role structure from department hierarchy data.

:::BlockQuote
\<workflow>
&#x20; \<clearImport />
&#x20; \<import>
&#x20;   \<provider>Innovation.Activate.Library\Innovation.Activate.Connectors.ImportText\</provider>
&#x20;   \<fileName>C:\Imports\departments.csv\</fileName>
&#x20;   \<headers>true\</headers>
&#x20; \</import>
&#x20; \<processImport />
&#x20; \<process>
&#x20;   \<provider>Innovation.Activate.Library\Innovation.Activate.Connectors.RoleChangeHandler\</provider>
&#x20;   \<role>
&#x20;     \<root>=//Roles/Departments\</root>
&#x20;     \<key>DepartmentCode\</key>
&#x20;     \<field>departmentCode\</field>
&#x20;     \<parent>parentCode\</parent>
&#x20;     \<name>=/department\</name>
&#x20;     \<parameters>
&#x20;       \<departmentCode name="DepartmentCode" type="String">=/departmentCode\</departmentCode>
&#x20;     \</parameters>
&#x20;     \<events>
&#x20;       \<missing>
&#x20;         \<createRole>
&#x20;           \<description>Created by import %=//System/Now%\</description>
&#x20;         \</createRole>
&#x20;       \</missing>
&#x20;     \</events>
&#x20;   \</role>
&#x20; \</process>
\</workflow>
:::

# Ticket Synchronisation Example

**Goal:** Synchronise external service desk tickets and update state in Activate.

:::BlockQuote
\<workflow>
&#x20; \<clearImport />
&#x20; \<import>
&#x20;   \<provider>Innovation.Activate.Library\Innovation.Activate.Connectors.ImportSql\</provider>
&#x20;   \<connectionString>Server=SQL01;Integrated Security=true;Initial Catalog=Tickets;\</connectionString>
&#x20;   \<sql>SELECT \* FROM ExternalTickets\</sql>
&#x20; \</import>
&#x20; \<processImport />
&#x20; \<process>
&#x20;   \<provider>Innovation.Activate.Library\Innovation.Activate.Connectors.ServiceDeskTicketChangeHandler\</provider>
&#x20;   \<ticket>
&#x20;     \<match field="ticketNumber">=/ticketNumber\</match>
&#x20;   \</ticket>
&#x20;   \<events>
&#x20;     \<update>
&#x20;       \<ticket>
&#x20;         \<ticketNumber>=/ticketNumber\</ticketNumber>
&#x20;         \<state>=/state\</state>
&#x20;         \<status>=/status\</status>
&#x20;         \<notes>=/notes\</notes>
&#x20;       \</ticket>
&#x20;     \</update>
&#x20;   \</events>
&#x20; \</process>
\</workflow>
:::

# Combining Connectors

- Use **multiple connectors** to manage different domains (e.g., HR → Users, Departments → Roles, Tickets → Service Desk).&#x20;
- Keep imports lightweight by focusing each connector on a single purpose.&#x20;
- Chain connectors via scheduled workflows for dependent updates.&#x20;

# Testing Patterns

- Run connectors with small datasets until results are validated.&#x20;
- Use processImport/maxChanges guardrails.&#x20;
- Monitor connector data tables directly for unexpected deletions.&#x20;
- Trigger a manual workflow run before enabling schedules.&#x20;
