Skip to content

Job identifiers

Preview

This feature is not subject to our service terms. Pre-GA features are available as is and might have limited support.

When your application sends a job request to Modigie, it must publish the message with the Pub/Sub attribute modigieJobRequestId with an ID that is unique for the repository to which your application is connected. This also works as an idempotency key to prevent accidental duplicates. On success, this value becomes the job's id and part of the job's unique identifer name. Your application should store the request ID to avoid sending later a different payload with the same ID.

If your job request gets discarded, the repository will not create a job and therefore the job response message will not include an id or name property.

id, name, and repository are read-only properties.

Uniqueness

The truly unique identifier of your job is found in the name property. The name property is a read-only value that combines the unique identifier of your repository, the repository.name value, and your job's id value.

Important

There is no other job in the Modigie Integration for Cloud Pub/Sub that has the same name value. In other words, there can be multiple jobs with the id="personA_enrichMobile_1" in different Pub/Sub repositories, but only one job with the name="repositories/my-synth-1/jobs/personA_enrichMobile_1".

Let's assume the following scenario: Modigie provide you with a Modigie Org Account with the id = "Q8IRqGvOcGG8lt4dWa3e". For this org account, Modigie also provided you with a Pub/Sub repository with the id = "my-synth-1" that gives your application a topic to publish job requests of job type enrichMobile.

If your application publishes now a job request message with the attribute modigieJobRequestId = personA_enrichMobile_1 to the topic, the connected repository will create a job in its pipeline and publish a job response message like this:

job-response.json
{
  "id": "personA_enrichMobile_1",
  "name": "repositories/my-synth-1/jobs/personA_enrichMobile_1",
  "repository": {
    "id": "my-synth-1",
    "name": "repositories/my-synth-1",
    "repoType": "inpubsub",
    "org": {
      "id": "Q8IRqGvOcGG8lt4dWa3e",
      "name": "orgs/Q8IRqGvOcGG8lt4dWa3e"
    }
  },
  ...
}

Idempotency

If your application successfully sends a job request with the attribute modigieJobRequestId = "my-job-1", the connected repository will create a job with the id = "my-job-1" in its pipeline. If your application later sends another request with the same modigieJobRequestId = "my-job-1"...

  • ...and the job's payload is identical to the first request, no duplicate job will be created. However, if the job already terminated, your application will receive (another) message with the job response. This job request is legitimate, and the returned message will not have the attribute modigieJobDiscardReasonType. You can use this to get lost messages delivered again.

  • ...and the job's payload is NOT IDENTICAL to the first request, the job will be discarded; that is, no duplicate job will be created. Your application will receive one message with the attributes modigieJobDiscardReasonType = "DuplicateJobIdError" and modigieJobRequestId = "my-job-1". If your application receives messages with the attribute modigieJobDiscardReasonType, you may want to investigate the root cause.

We recommend that your application uses a pattern that guarantees a unique job ID. You may accomplish this by combining the unique ID of the record for which your application requires validation, verification, or enrichment by Modigie; the job type that you want to request; and an increment that you can use if you actually want to create a duplicate job.

modigieJobRequestId = "{prospectId}_{jobType}_{increment}"

For example, for a prospect with the ID personA, you want to run a job of type enrichMobile. The first time, you use the increment 1. This results in this ID:

modigieJobRequestId = "personA_enrichMobile_1"

If you want to retry the exact same payload, your application could just increment and use:

modigieJobRequestId = "personA_enrichMobile_2"

Pattern

The request ID must be a string with a length of at least 1 character and at most 256 characters. It must consist of Latin characters between a and z (lower-case) or A and Z (upper-case), digits between 0 and 9, or the characters -, ., _.

As a regular expression: ^[a-zA-Z0-9\-._]{1,256}$

Example

modigieJobRequestId = personA_enrichMobile_1
The ID of the job request must be unique in your repository. If the repository creates the job, the request ID becomes the id value of the job resource.

Note

id, name, and repository are read-only properties.

modigieJobRequestId = personA_enrichMobile_1
The request ID from your original job request became the job's id value.
job-response.json
{
  "id": "personA_enrichMobile_1",
  "name": "repositories/my-synth-1/jobs/personA_enrichMobile_1",
  "repository": {
    "id": "my-synth-1",
    "name": "repositories/my-synth-1",
    "repoType": "inpubsub",
    "org": {
      "id": "Q8IRqGvOcGG8lt4dWa3e",
      "name": "orgs/Q8IRqGvOcGG8lt4dWa3e"
    }
  },
  ...
}