How to test an AJO custom action end to end
By 16Labs · Updated
Short answer: point the custom action at a receiver URL that records every call, check the success and error responses with cURL, then run a closed-loop test: send a unitary event into the journey with a correlation id and confirm the custom action calls the receiver with the payload you expect. The 16Labs AEP Lab does all three against a development sandbox, with synthetic data only.
Why custom actions are hard to test
A custom action is an outbound HTTP call that Journey Optimizer makes on your behalf. When it fails, the journey usually keeps going: the call is retried or dropped, and nothing in the journey canvas shows you the request that was sent. Testing against the real endpoint mixes two questions together: "did AJO send the right thing?" and "did my service handle it?".
A receiver separates them. It records exactly what AJO sent, answers with a response you control, and can return an error on demand.
Step 1: create a receiver
In the 16Labs AEP Lab, go to AEP Lab → AJO Receivers → New receiver:
- Kind: Custom action (AJO sends POST).
- Authentication: none, API key, Basic, or a static Bearer token. AJO has no "Bearer" type, so a Bearer token is configured in AJO as an API key named
Authorizationwith the valueBearer <token>, in the header. - Request payload sample: the JSON AJO will send. Write
"{{name}}"for each value the journey fills in. - Response sample (HTTP 200) and Error sample (HTTP 500, returned when the call has
?rr_fail=1). - Expected JSON Schema (optional): every call is validated against it.
Step 2: paste it into Journey Optimizer
The receiver page has a paste-into-AJO panel with the URL, method, headers (Constant or Variable), authentication block, request payload and response samples, in the order AJO's Configurations → Actions screen asks for them.
Adobe's rules for custom action endpoints apply: JSON payloads only, default ports (443 for HTTPS), and no IP addresses. Receivers are served over HTTPS, so they meet those rules. Endpoints slower than 0.75 seconds are routed through a slower service, so keep the receiver's response delay low unless you are testing that case.
Step 3: check both paths with cURL
The panel gives you two cURL commands: one for the success path and one with ?rr_fail=1 for the error path. Run them and confirm each call appears under Calls with its headers (secrets masked), body, schema result and the response it got. A call that fails authentication is still recorded and answered 401, so a wrong key shows up as a row you can read.
Step 4: prove the journey with a loop test
- Add a correlation field to your unitary event's schema and set its path on the AEP Lab connection.
- In the journey, map the event's correlation field into the custom action payload (for example
$.rr_correlation_id), along with any profile values you want to check. - Create a loop test with the expected values, one per line, such as
$.email = {{profile.email}}. - Run it. The Lab sends the event with a fresh
rr-corr-…id, waits for the receiver to get a call carrying the same id, and compares it.
The outcome is PASSED, FAILED (with a diff), TIMED_OUT (with what the Lab did see) or BLOCKED (a guard refused the event because of the sandbox or the data).
Run it on every change
Schedule the loop test as a monitor, or start it from CI with an adobe:run token. See Running AEP and AJO regression checks in CI.