Workday to ServiceNow Service Worker Migration

(0 reviews)


Moves a large set of workers from Workday to ServiceNow. You can trigger this manually or programmatically with an HTTP call.

The template has the ability to specify a filtering criterion and a desired course of action when a user already exists in the destination system. This template uses batch to efficiently process many records at a time.


License Agreement

This template is subject to the conditions of the MuleSoft License Agreement. Review the terms of the license before downloading and using this template. You can use this template for free with the Mule Enterprise Edition, CloudHub, or as a trial in Anypoint Studio.

Use Case

As a Workday admin I want to migrate workers from Workday to users in ServiceNow.

This template serves as a foundation for the process of migrating Workers from Workday instance to Users in ServiceNow, being able to specify filtering criteria and desired behavior if a user already exists in the destination system.

As implemented, this template leverages the Mule batch module. The batch job is divided into Process and On Complete stages. The template queries Workday for all the existing active workers that match the filter criteria. The criteria is based on manipulations starting from the given date. The last step of the Process stage creates or updates the users in ServiceNow based on if a user already exists in the system. Finally during the On Complete stage the template outputs statistics data into the console and sends a notification email with the results of the batch execution.


There are a couple of things you should take into account before running this template:

  1. Workday e-mail uniqueness: The email can be repeated for two or more accounts (or missing). Therefore Workday accounts with duplicate emails are removed from processing.
  2. Users in ServiceNow are matched with Workday Workers based on the user_name. If user_name is not specified, then the matching is based on the email, first_name, and last_name.

ServiceNow Considerations

Here's what you need to know to get this template to work with ServiceNow.

As a Data Destination

There are no considerations with using ServiceNow as a data destination.

Workday Considerations

As a Data Source

There are no considerations with using Workday as a data origin.

Run it!

Simple steps to get this template running.

When you run this template this is an example of the output you see after you browsing to the HTTP connector:

    "Message": "Batch Process initiated",
    "ID": "25cb73d0-5e82-11e8-a6fe-100ba905a441",
    "RecordCount": 2,
    "StartExecutionOn": "2018-05-23T14:09:30Z"

Running On Premises

In this section we help you run this template on your computer.

Download Anypoint Studio and the Mule Runtime

If you are new to Mule, download this software:

Note: Anypoint Studio requires JDK 8.

Import a Template into Studio

In Studio, click the Exchange X icon in the upper left of the taskbar, log in with your Anypoint Platform credentials, search for the template, and click Open.

Run on Studio

After you import your template into Anypoint Studio, follow these steps to run it:

  1. Locate the properties file, in src/main/resources.
  2. Complete all the properties required per the examples in the "Properties to Configure" section.
  3. Right click the template project folder.
  4. Hover your mouse over Run as.
  5. Click Mule Application (configure).
  6. Inside the dialog, select Environment and set the variable mule.env to the value dev.
  7. Click Run.

Run on Mule Standalone

Update the properties in one of the property files, for example in, and run your app with a corresponding environment variable. In this example, use mule.env=prod.
After this, to trigger the use case you just need to browse to the local HTTP connector with the port you configured in your file. If this is, for instance, 9090 then browse to: http://localhost:9090/migrateworkers and this outputs a summary report and sends it in the email.

Run on CloudHub

When creating your application in CloudHub, go to Runtime Manager > Manage Application > Properties to set the environment variables listed in "Properties to Configure" as well as the mule.env value.

Once your app is all set up and started, if you choose wdayworkermigration as domain name to trigger the use case, you just need to browse to and a report is sent to the email configured.

Deploying a Template in CloudHub

In Studio, right click your project name in Package Explorer and select Anypoint Platform > Deploy on CloudHub.

Properties to Configure

To use this template, configure properties such as credentials, configurations, etc.) in the properties file or in CloudHub from Runtime Manager > Manage Application > Properties. The sections that follow list example values.

Application Configuration

Application Configuration
  • http.port 9090
  • page.size 100
  • migration.startDate "2018-01-01T23:57:59"
Workday Connector Configuration
  • wday.username joan
  • wday.tenant acme_pt1
  • wday.password joanPass123
  • wday.hostname
ServiceNow Connector
  • snow.user snow_user1
  • snow.password ExamplePassword881
  • snow.endpoint
SMTP Services Configuration
  • smtp.port 587
  • smtp.user
  • smtp.password secret
Email Details
  • mail.from
  • mail.subject Users Migration Report

API Calls

There are no special considerations regarding API calls.

Customize It!

This brief guide provides a high level understanding of how this template is built and how you can change it according to your needs. As Mule applications are based on XML files, this page describes the XML files used with this template. More files are available such as test classes and Mule application files, but to keep it simple, we focus on these XML files:

  • config.xml
  • businessLogic.xml
  • endpoints.xml
  • errorHandling.xml


This file provides the configuration for connectors and configuration properties. Only change this file to make core changes to the connector processing logic. Otherwise, all parameters that can be modified should instead be in a properties file, which is the recommended place to make changes.


The functional aspect of this template is implemented in this XML file, directed by a flow responsible for executing the logic. For the purpose of this template, the mainFlow just executes the batch job which handles all its logic.


This is the file where you find the inbound and outbound sides of your integration app.
This template has only an HTTP Listener as the way to trigger the use case.

HTTP Listener Connector - Start Report Generation

  • ${http.port} is set as a property to be defined either on a property file or in CloudHub environment variables.
  • The path configured by default is migrateworkers and you are free to change for the one you prefer.
  • The host name for all endpoints in your CloudHub configuration should be defined as localhost. CloudHub routes requests from your application domain URL to the endpoint.
  • The endpoint is a request-response since as a result of calling it, the response is the total of workers synced and filtered by the criteria specified.


This file handles how your integration reacts depending on the different exceptions. This file provides error handling that is referenced by the main flow in the business logic.


Published by
MuleSoft Organization
Published onNov 14, 2018
Asset overview

Asset versions for 2.1.x

Asset versions


MigrationNo values left to add
UserWorkerNo values left to add
HCMNo values left to add
WorkdayServiceNowNo values left to add