An email flow can do more than page people. When a matching email arrives, it can have one of your servers do something about it, using values pulled out of that email:
- Submit a JAMS job, if you use JAMS Scheduler. The job holds the work: PowerShell, a command, SQL, a file transfer, whatever the job type is. The email supplies the parameters.
- Run a script from a folder on one of your servers, if you don't use JAMS Scheduler.
This page explains how both work. The two linked pages cover setup.
Who sees these options. An admin sees Submit a JAMS job on an email flow when the account has the JAMS Scheduler integration and an Agent (JAMS Incident Connector) is connected. Run a script appears on Starter plans and above when a Windows Agent is connected. If neither shows, connect an Agent first under Integrations.
What you need
- An email flow with conditions, and usually some values pulled out of the email. See Email: Conditions & Values from the Email.
- A JAMS Incident Connector (Agent) installed and paired on the server that will do the work. The action only appears in the flow when a suitable Agent is paired:
- Submit a JAMS job needs an Agent set up for JAMS Scheduler (the same one used for its alerts).
- Run a script can use any Windows Agent, whether set up for JAMS Scheduler or for Windows service monitoring.
- Recipients on the flow. These are the people paged when the action can't be done. They're still required, because an alert is never dropped.
Each flow can have one action. If you need two different things to happen, use two flows.
Two ways to run it
When you turn on an action, choose how it runs.
Run automatically
The action happens as soon as the email arrives, without waiting for a person.
- If it works, the alert is acknowledged automatically and nobody is paged. History shows it was handled, e.g. Acknowledged · Sent to JAMS job or Acknowledged · Ran script.
- If it doesn't work, the flow's recipients are paged as normal, and the alert says why, e.g. "The JAMS job \Ops\Disk\Cleanup was NOT submitted automatically: there is no JAMS job at that path."
Choose this when the fix is routine and you only want to hear about it when it fails.
Ask the person paged
The recipients are paged as usual, and the action is added as a choice on the alert. 1 is always Acknowledge; the action gets the next number, usually 2. On a call it's read out: "Press 2 or say submit to submit JAMS job Cleanup." By text or WhatsApp they reply with that number. It also appears as a button in Teams, Slack, the dashboard and the mobile app.
You don't need to mention the number in your custom alert message; the menu is added for you.
- Choosing it runs the action with the values from that email, and the alert is acknowledged in that person's name.
- If it doesn't work, they're told why straight away, and the alert stays open so they can deal with it another way.
- It can only be run once per alert. If two people choose it, or someone presses twice, the second is told it's already been done or is in progress.
Choose this when a person should decide, for example because the action restarts something users would notice.
Everything that can happen
| Situation | Run automatically | Ask the person paged |
|---|---|---|
| The action works | Alert acknowledged, nobody paged | Alert acknowledged in the chooser's name |
| The action fails (job missing, script exits with an error, permission denied…) | Recipients paged, with the reason | The person is told why; the alert stays open |
| A value the action needs wasn't found in the email | Nothing runs; recipients paged with the reason | The choice isn't offered; the alert says why |
| The Agent doesn't answer (server down, service stopped) | After a short wait, recipients paged with the reason. The request is withdrawn, so it can't run later by surprise. | The person is told it isn't confirmed; the alert stays open |
| The Agent is no longer paired | Recipients paged with the reason | The person is told why |
| Alerting is paused for maintenance | Nothing runs and nobody is paged | Nothing is sent |
| The same email arrives again | Ignored, as for any email flow | Ignored |
How long is "a short wait"? Up to 2 minutes for a JAMS job and 3 minutes for a script. During that time the alert is held, not lost. If the Agent answers in time, you only hear about failures. If it doesn't, people are paged with the reason.
Runaway protection still applies. If a flow starts firing far more than usual, runaway control folds the alerts together, and actions stop running while it does. A loop of emails won't run a job a hundred times.
What you'll see afterwards
- On the alert: who or what acknowledged it. Automatically: Acknowledged · Sent to JAMS job (in Teams and Slack, JAMS job submitted automatically). In Ask mode it names the person and how they answered, e.g. JAMS job submitted by Kevin Casey via Voice call (keypad).
- On the dashboard: for a JAMS job, the Job column shows the job's name and its entry number, and View Log opens the job's log.
- When a JAMS job finishes: by default you're alerted if it fails. You can also choose to be told when it completes. See When the job finishes.
- In the audit log: when the action was queued, offered, finished or failed, and why. For a JAMS job that includes the entry number. For a script it includes the exit code and the last lines of its output.
- In the alert text, whenever an action didn't happen: a sentence saying so, and why.
Security in plain terms
Anyone who can send an email to the mailbox can trigger the flow, so actions are deliberately limited:
- Nothing is run from the email itself. The email only supplies values. What runs is fixed by an admin: a specific JAMS job, or a script file an administrator placed on the server.
- Values are passed as data, never as commands. A value like
x & del C:\*arrives at the job or script as text, not as something to execute. (Your own job or script should treat it as text too. AvoidInvoke-Expressionon values that come from an email.) - A JAMS job path built from the email must stay inside a folder you choose, so a crafted email can't pick a different job.
- Make sender conditions specific. A From condition makes accidental matches less likely, but email senders can be faked, so don't rely on it alone for anything sensitive.
- Use "Ask the person paged" for anything that shouldn't happen without a human deciding.
Frequently asked
Can the email create new job parameters in JAMS Scheduler, or change the job? No. It can only fill in values for parameters the job already has, for that one run. See Submit a JAMS job.
Will I hear whether the JAMS job itself worked, not just that it started? Yes. JAMS Incident Management follows the job until it finishes and alerts the flow's recipients if it fails. You can also ask to be told when it completes. Open View Log on the alert to read the job's log. See When the job finishes. For a script, success means it finished with exit code 0.
Does a handled alert count toward my notification allowance? An alert acknowledged automatically before anyone was paged sends nothing, so nothing is charged.