ADP Workforce Now (Apps step)
ADP Workforce Now
Lists and reads ADP Workforce Now workers and reads their pay statements through ADP's API, signed in with an ADP API Central or Marketplace app and its client certificate.
Use it to bring ADP Workforce Now's people data into the plant: a current roster with job titles and departments, new hires for badge and training setup, or a worker's recent pay statements for a payroll check.
Beta. This step has not yet been checked against a live ADP Workforce Now account, so treat its first runs as a test, and tell us if an operation does not answer as described.
Find it in the workflow editor's palette under Apps. See Apps steps for what every Apps step has in common.
Set it up
- In ADP, get API access for Workforce Now: an API Central project (your ADP admin adds API Central and creates a project) or an ADP Marketplace partner app. Note its client id and client secret and grant it the Workers and Pay Statements APIs.
- Make a private key and a certificate signing request (CSR) as ADP's instructions describe, upload the CSR to ADP, and download the certificate ADP signs.
- In DataMagik, open Script Engine › Credentials and add a Client Certificate credential holding ADP's signed certificate and your private key, and an OAuth 2.0 credential with grant "Client credentials", the client id and secret, and the token URL below.
- Add api.adp.com and accounts.adp.com to Allowed Domains in the workflow's Script settings.
Credential: An OAuth 2.0 client credentials credential with your ADP app's client id and secret and token URL https://accounts.adp.com/auth/oauth/v2/token, plus a Client Certificate credential with the certificate ADP signed and its private key, chosen on the step.
Signing in with OAuth 2.0
| Grant type | Client credentials |
| Token URL | https://accounts.adp.com/auth/oauth/v2/token |
| Scope | Leave it empty. |
ADP needs no scope for client credentials: leave the scope empty. ADP only answers callers that present the certificate it signed (mutual TLS), both at the token URL and on every API call: make a CSR, have ADP sign it through API Central or the Marketplace app, put the signed certificate and your private key in a Client Certificate credential, and choose it in the step's Client certificate field. ADP's certificates expire (usually after two years); renew them in ADP before then and update the credential.
Hosts it calls: api.adp.com, accounts.adp.com
Operations
| Operation | What it does |
|---|---|
| Worker › List | Lists the company's workers, 100 per request, following every page up to the step's page limit. |
| Worker › Get | Reads one worker by their associate OID. |
| Pay statement › List for worker | Lists one worker's recent pay statements (summaries; each has a link to its full detail). |
Worker › List
Lists the company's workers, 100 per request, following every page up to the step's page limit.
Calls GET /hr/v2/workers. Follows the pages, up to Most pages (10 unless you change it).
What comes out: One item per worker: {{ $json.associateOID }}, {{ $json.workerID.idValue }} (the employee number), {{ $json.person.legalName.givenName }}, {{ $json.person.legalName.familyName1 }}, {{ $json.person.legalName.formattedName }}, {{ $json.workerStatus.statusCode.codeValue }} (Active, Terminated…), {{ $json.workerDates.originalHireDate }} and {{ $json.workAssignments }} with each position's job title and department.
Example: List the workers each night and update the plant's operator table with each one's name, status and home department.
Worker › Get
Reads one worker by their associate OID.
Calls GET /hr/v2/workers/{aoid}.
| Field | Required | What to put |
|---|---|---|
| Associate OID | Yes | The worker's ADP associate OID (associateOID on List), not their employee number. For example G3ABCDEF0123456. Choose from list beside the field fetches the choices from your account. |
What comes out: One item: the worker, with {{ $json.associateOID }}, {{ $json.workerID.idValue }}, {{ $json.person }} (name, birth date, addresses), {{ $json.businessCommunication }} (work email and phone), {{ $json.workerStatus }}, {{ $json.workerDates }} and {{ $json.workAssignments }}.
Example: When a badge is scanned for an unknown operator, read the worker by {{ $json.aoid }} and check {{ $json.workerStatus.statusCode.codeValue }} is Active.
Pay statement › List for worker
Lists one worker's recent pay statements (summaries; each has a link to its full detail).
Calls GET /payroll/v1/workers/{aoid}/pay-statements.
| Field | Required | What to put |
|---|---|---|
| Associate OID | Yes | The worker's ADP associate OID (associateOID on List), not their employee number. For example G3ABCDEF0123456. Choose from list beside the field fetches the choices from your account. |
| Last pay dates | No | How many of the most recent pay dates to return. Leave empty for ADP's default. For example 5. |
What comes out: One item per pay statement: {{ $json.payDate }}, {{ $json.netPayAmount.amountValue }}, {{ $json.grossPayAmount.amountValue }}, {{ $json.totalHours }} and {{ $json.payDetailUri.href }} (the address of its full detail).
Example: List the last 2 pay dates for {{ $json.aoid }} and compare {{ $json.totalHours }} with the hours the plant's time clock recorded.
Trigger: ADP Workforce Now: New Items
Under Triggers in the palette. It looks at ADP Workforce Now on a schedule (every 15 minutes unless you change Look every) with one of these operations: Worker › List, and starts the workflow with the items it has not seen on an earlier look, one item each. Saving the workflow sets up the schedule.
- New means: not seen before, by the item's id (or the field you name in Item field), or newer than the newest one last time, by a date or increasing number.
- On the first run it only remembers what is there, unless you choose Start with everything.
- Test runs show what would be new without remembering it. It remembers the last 5000 ids, so filter the list to keep it shorter than that.
Example
An ADP Workforce Now: New Items trigger on List workers starts the workflow for each new associate; a Database step adds {{ $json.person.legalName.formattedName }} and {{ $json.workerID.idValue }} to the training matrix.
Tips
- ADP names each worker by an associate OID (associateOID, a long code such as G3ABCDEF0123456) that stays the same for life; the employee number people know is {{ $json.workerID.idValue }}.
- A worker's job, department and status are in {{ $json.workAssignments }}, a list with one entry per position; the primary one has primaryIndicator true.
- Both credentials are needed on every step: the OAuth 2.0 credential for the token and the Client Certificate credential for ADP's mutual TLS. An error about the TLS handshake means the certificate is missing, expired or not the one ADP signed.
- ADP's API reads real payroll data on test runs too; ask ADP for a test (partner sandbox) company while building if you have one.
Settings every Apps step has
- More query parameters: any query parameter the fields do not offer, sent as is.
- More body fields: a JSON object merged into the request body; nested objects merge, other values replace.
- Most requests per second: spaces the calls out for rate limits. A "too many requests" (429) answer is retried after the wait the API asks for.
- Most pages: for operations that follow pages, the most pages to fetch (10 unless you change it, up to 100). The run warns when it stops with more to get.
- Fail on a non-2xx response: on by default. Turn it off to handle errors yourself.
ADP Workforce Now's own API documentation: https://developers.adp.com/build/api-explorer/hcm-offrg-wfn