Skip to main content

Step 1 - Find Alma Users Without Expiration Dates

At a glance

Status: Inactive
Workflow ID: 9hWFoIOOCuguN86e
Version: 95997d36-81cc-43b3-9d5a-811a6960d07c
Environment / Tags: User Record Management; NZ Sandbox; NZ Production
Applies consortium-wide?: No
Runs on: NZ Sandbox and a second selectable Alma environment labeled NZ Production
Trigger: A LibOW web form submitted on demand; there is no automatic schedule.
Primary outcome: Scans Alma user records and emails a CSV listing accounts whose expiry_date is missing or blank.
Who receives results: shields@wrlc.org

Why this exists

User records without an expiration date may remain eligible longer than intended and can be difficult to locate through routine review. This workflow gives staff a repeatable audit that can be run against a selected Alma environment, first on a limited set of records for testing or across all available users.
The results provide the starting CSV for later workflows that assign purge dates and manage expired accounts.

What it does

•    Presents a form where the operator chooses NZ Sandbox or NZ Production and enters the maximum number of users to scan.
•    Treats a maximum of 0 as “scan all available users”; positive values are capped at 10,000.
•    Routes the request to the Alma node associated with the selected environment.
•    Requests full Alma user records in pages of up to 100.
•    Checks each returned user for an absent, null, blank, or empty-object expiry_date.
•    Extracts the Primary ID, preferred or first email address, and patron group for matching users.
•    Stores matching rows and internal page-state rows in the users_missing_expiration LibOW data table.
•    Continues requesting pages until it reaches the selected limit or Alma’s total record count.
•    Builds a CSV report and emails it when matches exist.
•    Sends a no-results email when no matching users are found.

Where it runs

Alma IZ(s)
•    NZ Sandbox
•    A second branch labeled NZ Production

Systems touched

•    LibOW / n8n: Hosts the form and coordinates the workflow.
•    Alma Users API: Retrieves full user records. An API is a controlled way for one system to request data from another.
•    LibOW Data Tables: Temporarily stores matching rows and page-state information.
•    Gmail: Delivers the report or no-results notice.

Credentials referenced
•    NZ Sandbox - Alma APIs - Read Only
•    SCF Sandbox - Alma APIs - Read Only
•    Gmail Credentials - Generic LibOW

Reports / queries used

No Alma Analytics report is used.

The workflow queries the Alma Users API with:
•    Full expansion
•    Page size up to 100
•    Offset-based pagination

LibOW data table:
•    users_missing_expiration

How it works

Logic overview
The workflow validates the form, creates a timestamp-based run ID, and starts at offset zero. A Switch node selects the environment-specific Alma API node. Each response page is inspected in JavaScript rather than with a visual filter, allowing the workflow to detect several ways an expiration field can be missing or empty.
A page-state row records the next offset and whether more records remain. After the final page, the workflow retrieves all rows for the current run, removes the internal state rows, and creates the report.

If results exist:

The workflow creates and emails a CSV containing:
•    Primary ID
•    Email Address
•    Patron Type

The email includes the run ID, selected environment, number of users scanned, and number of users without an expiration date.

If no results exist:

The workflow sends an email confirming completion and reporting that zero users without an expiration date were found. No attachment is sent.

CSV filename pattern:
alma-users-missing-expiration-<run ID>.csv