Bulk Enqueue Postings to Generate Leads Action

Enqueues recruitment posting IDs so that candidate leads are generated asynchronously.

This action is available in API version 68.0 and later.

Pass one or more RecruitmentPosting IDs to enqueue asynchronous candidate lead generation. Duplicate IDs are removed before enqueueing. Postings that generated leads in the last 24 hours are skipped. The action returns as soon as the postings are enqueued and doesn't wait for leads to be created. Use it from a scheduled flow, a process, or REST API.

You can pass up to 2,000 posting IDs in one request. If you pass more, the request fails with the INVALID_INPUT error.

Special Access Rules

To access the Bulk Enqueue Postings to Generate Leads action, your org must have the Talent Recruitment Management Specialist Add-on, and the user must have the Talent Recruitment Management Specialist Access permission set. When you invoke this action from a scheduled flow, it runs as the Automated Process user. For setup, see Set Up Lead Sourcing.

Supported REST HTTP Methods

URI
/services/data/v68.0/actions/standard/bulkEnqueuePostingsToGenLeads
Formats
JSON
HTTP Methods
GET, POST
Authentication
Authorization: Bearer token

Inputs

Input Details
recruitmentPostingIds
Type
String[]
Description

Required.

A collection of RecruitmentPosting record IDs to enqueue for candidate lead generation. Accepts 15-character or 18-character IDs. You can also pass a comma-separated string of IDs. The action normalizes IDs to the 15-character format and removes duplicates, keeping the first occurrence of each ID. Maximum 2,000 IDs per request. Non-existent posting IDs are reported as FAILED in the response.

Outputs

Output Details
enqueuedPostings
Type
Apex-defined variable
Description
The enqueue result for each recruitment posting ID. Each item includes:
  • recruitmentPostingId (String)—The recruitment posting ID from the request.
  • status (String)—The outcome of the enqueue attempt. Valid values:
    • ENQUEUED—The posting was enqueued. Lead generation continues asynchronously.
    • SKIPPED—The posting wasn't enqueued because it generated leads in the last 24 hours. Skipped postings don't cause the overall action to fail.
    • FAILED—The posting couldn't be enqueued. See errorMessage.
  • mqMessageId (String)—The message ID of the enqueued request. Returned only when status is ENQUEUED. Retain this value to track the asynchronous request.
  • errorMessage (String)—Why the posting wasn't enqueued. Returned only when status is SKIPPED or FAILED.
responseMessage
Type
String
Description
A summary of the operation, such as how many postings were enqueued, skipped, or failed.

The invocable action result also includes isSuccess. This value is true when every posting is ENQUEUED or SKIPPED. If any posting is FAILED, isSuccess is false and the result includes errors. Always inspect status on each item in enqueuedPostings.

Example

GET
This example shows how to get the details of the Bulk Enqueue Postings to Generate Leads action type.
1curl --include --request GET \
2--header 'Authorization: Bearer 00DR...xyz' \
3--header 'Content-Type: application/json' \
4"https://instance.salesforce.com/services/data/v68.0/actions/standard/bulkEnqueuePostingsToGenLeads"
POST
Here’s a request for the Bulk Enqueue Postings to Generate Leads action.
1{
2  "inputs": [
3    {
4      "recruitmentPostingIds": [
5        "a03xx0000001QzAAI",
6        "a03xx0000001QzBAI"
7      ]
8    }
9  ]
10}
Here’s a response for the Bulk Enqueue Postings to Generate Leads action.
1[
2    {
3        "actionName": "bulkEnqueuePostingsToGenLeads",
4        "errors": null,
5        "invocationId": null,
6        "isSuccess": true,
7        "outcome": null,
8        "outputValues": {
9            "enqueuedPostings": [
10                {
11                    "recruitmentPostingId": "a03xx0000001QzAAI",
12                    "status": "ENQUEUED",
13                    "mqMessageId": "707xx0000004L1vAAE"
14                },
15                {
16                    "recruitmentPostingId": "a03xx0000001QzBAI",
17                    "status": "SKIPPED",
18                    "errorMessage": "Posting generated leads within the last 24 hours"
19                }
20            ],
21            "responseMessage": "Enqueued 1 posting(s). Skipped 1 (generated within last 24h). 0 failed."
22        },
23        "sortOrder": -1,
24        "version": 1
25    }
26]