Skip to main content
When a job instance or a workflow instance fails, PowerJob posts a JSON alarm to the WebHook address of each notified user selected on the job (or workflow). Set that address to the Flashduty push URL, and every failed run creates one Flashduty alert with Critical severity. PowerJob alarms only on failure and sends nothing when a run succeeds, so the alert does not recover on its own. Turn on auto-close in the channel, see Alerts do not recover.

In Flashduty On-call

You can get the push URL in either of the following ways.

Use a dedicated integration

  1. In the Flashduty console, select Channels and open a channel
  2. Select Settings → Integration data → Dedicated integration, then click Add integration
  3. Select PowerJob and click Save
  4. Open the generated integration card and copy the Push URL

Use a shared integration

  1. In the Flashduty console, go to Integration Center → Alert Events
  2. Select PowerJob and enter an integration name
  3. Configure the default route and select a channel. You can add more rules under Routing after creation
  4. Click Save and copy the generated Push URL

In PowerJob

PowerJob sends alarms to users: first set a WebHook address on a user, then select that user on the job or workflow. This integration is verified against PowerJob 5.1.7.
1

Set the WebHook address on a user in PowerJob

Where: PowerJob console › Personal Center › Personal Info › WebHookThen save. If the address has no http:// or https:// prefix, PowerJob adds http://, so enter the full address starting with https://. The PowerJob server must be able to reach Flashduty on the public internet.
2

Select the notified users on a job

Where: PowerJob console › Create Job (or edit the job to monitor) › Alarm config › Alarm receiver(s)Save the job. Only selected users that have a WebHook receive the alarm, and PowerJob sends one request for each such user.
3

Select the notified users on a workflow

Where: PowerJob console › Workflow (create, or edit the workflow to monitor)Do the same as in the previous step for each workflow you want to monitor. PowerJob alarms only on failed executions; it sends no recovery notification and has no recovery switch, so there is nothing more to configure for recovery.
4

Verify

PowerJob has no test button, so make a job fail for real. For example, use the built-in StandaloneProcessorDemo processor with the job parameter set to failed. Run it and confirm Flashduty shows one Critical alert titled PowerJob job failed: <job name>. The alert does not recover on its own; see Alerts do not recover.

Alerts do not recover

PowerJob sends no recovery notification, and it does not alarm when a job later succeeds. In the channel that receives this integration, turn on auto-close. We suggest 12 hours; adjust to how quickly your team handles failed jobs. Each failed run is a separate alert. A job that is scheduled often (for example every minute) and keeps failing creates many alerts; use Flashduty alert grouping to reduce the noise.

Job failures and workflow failures

The integration tells the two alarms apart by their content:
  • Job failure: contains jobId and instanceId. The title is PowerJob job failed: <job name>, or job <jobId> when the name is missing
  • Workflow failure: contains workflowId and wfInstanceId. The workflow alarm of PowerJob 5.1.7 carries no workflow name, so the title is PowerJob workflow failed: workflow <workflowId>; find the workflow in the PowerJob console by that ID
If a job inside a workflow fails and that job also has notified users, PowerJob sends both a job failure alarm and a workflow failure alarm. They are two separate alerts in Flashduty. The alert description contains the execution result reported by PowerJob (cut at 1000 bytes). Job parameters, instance parameters, and the processor info (for example the body of a shell script) may hold secrets, so Flashduty does not read those fields.

Alert key

Every run has a new instance ID, so each failure is a new alert and the same run never alerts twice. Changes to the job name, result, or times do not change the Alert Key. A request without these fields is rejected. Instance IDs are long integers above 2^53; Flashduty keeps every digit of the original text.

Status and severity

PowerJob alarms carry no severity field and are sent only on failure, so every alert is in the triggered state with Critical severity.

Labels

Troubleshooting

  • Flashduty receives no event: confirm the failed job or workflow has notified users selected and that user has a WebHook; confirm the PowerJob server can reach Flashduty and that the push URL is complete with integration_key. When delivery fails, PowerJob only logs [WebHookAlarmService] invoke webhook ... failed on the server and does not retry
  • Flashduty returns an invalid-parameter error: the request lacks the fields listed under Alert Key, or it is not a PowerJob JSON alarm
  • The alert never closes: this is expected; turn on auto-close in the channel
  • No workflow name: see above, the workflow alarm of PowerJob 5.1.7 carries no name