Set up notifications with Zapier

How to receive notifications about job state changes with Zapier

Artificial's platform includes a Job Monitoring Service, which is designed to enhance the visibility of the status of the jobs running in your labs. You can integrate this service with services like Zapier to receive timely notifications to your team via Slack, Email, SMS, or any of the other apps Zapier supports.  

Currently, the service provides notifications for when:

  • Job actions go into "ERROR"
  • Job actions go into "ASSISTANCE NEEDED"
  • Jobs are completed
  • System logs including Information, Error, and Warning

To receive notifications, you will need to:

  1. Configure Zapier to receive notifications from Artificial
  2. Configure Zapier to route the incoming notifications to the services or people of your choice
    1. Example: Setting up Slack channel notifications for jobs in "Assistance Needed"
    2. Example: Setting up Slack messages for jobs in "Error" 

Step 1: Configure Zapier to receive notifications from Artificial

After logging into your Zapier account, follow the below steps. 

  1. Click on "Create" and select "New Zap"
  2. Click on the "Trigger" and select “Webhooks by Zapier”
    1. For the “Event” field, select “Catch Hook” and press Continue.
    2. Ignore the “Pick off a Child Key” field for now and press Continue again.
    3. Copy the webhook URL.
  3. Go to your Artificial Instance and select "Settings"
    1. Go to the "Lab" section, and select the lab you want to set up notifications for.
    2. Under the "Lab Configuration" section, enter a new key with the following information:
      1. Name: WEBHOOK_URL
      2. Value: Paste the webhook URL you copied in Zapier
      3. Save it.
  4. Test the trigger
    1. Run a job with an Assistant in that lab and test the trigger. You should see it come through! 
      1. You can also generate your own requests.

Your Zap should now be configured to receive incoming notifications! 

You will need to set the Lab Settings for each lab you want to receive notifications from. You can use the same URL for multiple labs or one URL per lab if you want to route notifications from different labs based on different rules. 

Step 2: Configure Zapier to route notifications from Artificial

Depending on what notifications you want to route and where you want to route them, these instructions will vary depending on your need! Generally, you will want to follow the below steps

  1. If testing the trigger is successful, press “Continue with Selected Record” or click on the block labeled “2. Action” in the workspace.

  2. Select the “Path” action type under "Built-in tools."

    1. Configure the paths to determine the route for notifications by:
      1. Select"Path Rules" to bring up rule configuration options
        1. For "only continue if," set the following:

          1. Field: Event Type

          2. Condition: (Text) Exactly Matches
          3. Insert Data...: You will select the Event Type that you want to be alerted of
            1. Options include:
              1. "ASSISTANCE_NEEDED": for when jobs require manual help with an Assistant
              2. "HAS_ERROR": for when jobs go into an error state
              3. "JOB_COMPLETED": for when jobs are completed
              4. "SYSTEM_LOG": for system log messages (information, error, warning)
                1. To filter by severity, you can add in an additional rule:
                  1. Data: Severity
                  2. Condition: (Text) Exactly Matches
                  3. Data: Select if you want ERROR, INFO, WARNING 

It can be useful to trigger each type of notification through Artificial to get Zapier to see what data it provides.

        1. Press Continue and confirm the path would have continued for this test data, and press Continue again. 

  1. Select the "Action" on the same Path.

    1. Select the action type for your preferred notification such as - "Slack," “SMS by Zapier,” “Email by Zapier," "Teams", and more.

    2. Configure the action type to your needs.
      1. For the message, write out the text you'd like to use. By selecting "Catch Hook in Webhooks by Zapier," you can add job details such as the name, action name, and more. If you want to hyperlink text with the job URL, use the format <URL| text>

For more information about Zapier's capabilities, see their Help Center

Below are examples to show how to configure:

  • Slack notifications to a channel for jobs that go into "Assistance Needed" 
  • Slack notifications directly to a user for jobs that go into "Error"
  • Email notifications for system log events that are errors

Example: Setting up Slack channel notifications for jobs in "Assistance Needed"

  1. If testing the trigger is successful, press “Continue with Selected Record” or click on the block labeled “2. Action” in the workspace.

  2. Select the “Path” action type under "Built-in tools."

  3. Select the "Path rules" block under Path A to bring up the rule configuration options.

  4. For "only continue if," set the following:

    1. Field: Event Type

    2. Condition: (Text) Exactly Matches
    3. Insert Data...: Event Type: ASSISTANCE_NEEDED
  5. Press Continue

  6. Confirm this path would have continued for this test data and press Continue again.

  7. Select the "Action" on the same Path.

  8. Select "Slack" for the action type.

    1. You can also pick “SMS by Zapier” or “Email by Zapier” to send notifications via text or email.

  9. For the “Event” field, select “Send Channel Message” and press Continue.

  10. Connect your Slack account to send messages and press Continue.

  11. Fill out the following fields in the “Action” form:
    1. Channel - Select the channel to which you want to send notification messages.
    2. Message Text - write out the text you'd like to use. By selecting "Catch Hook in Webhooks by Zapier," you can add job details such as the name, action name, and more. If you want to hyperlink text with the job URL, use the format <URL| text>
    3. Send as a bot:  Yes
    4. Bot Name - the name you want to send the message as; we’ve found it most helpful to send as the lab_name.
    5. Bot Icon - the icon that will show up next to the name; you can use any icon available in your slack instance (e.g. :fire:, :mechanical_arm:, or :octopus:)
    6. Include a link to this Zap? - No
  12. Press Continue
  13. Press “Test Zap” to send a Slack message based on your sample payload. You should see a new message in your selected channel.

Example: Setting up Slack messages for jobs in "Error" 


  1. Select the "Path rules" block under Path B to bring up the rule configuration options.

  2. For "only continue if," set the following:

    1. Field: Event Type

    2. Condition: (Text) Exactly Matches
    3. Insert Data...: Event Type: HAS_ERROR
  3. Press Continue

  4. Confirm this path would have continued for this test data and press Continue again.

  5. Select the "Action" on the same Path.

  6. Select "Slack" for the action type.

  7. For the “Event” field, select “Send Direct Message" and press Continue.

  8. Connect your Slack account to send messages and press Continue.

  9. Fill out the following fields in the “Action” form:
    1. To Username - select the user you want to send notification messages to.
    2. Message Text - write out the text you'd like to use. By selecting "Catch Hook in Webhooks by Zapier," you can add job details such as the name, action name, and more. If you want to hyperlink text with the job URL, use the format <URL| text>
    3. Send as a bot:  Yes
    4. Bot Name - the name you want to send the message as; we’ve found it most helpful to send as the lab_name.
    5. Bot Icon - the icon that will show up next to the name; you can use any icon available in your Slack instance (e.g. :fire:, :mechanical_arm:, or :octopus:)
    6. Include a link to this Zap? - No
  10. Press Continue
  11. Press “Test Zap” to send a Slack message based on your sample payload. You should see a new message in your selected channel.

 

Known Issue:

In some cases, you may get duplicate error notifications, one for the Action that encountered an error and one for an "Error Handler" Action. In this case, we recommend adding a Filter to your Zap to ignore the "Error Handler" notification.