← Google Calendar + PagerDuty integrations

Trigger Incident with PagerDuty API on New Event Start from Google Calendar API

Pipedream makes it easy to connect APIs for PagerDuty, Google Calendar and 1400+ other apps remarkably fast.

Trigger workflow on
New Event Start from the Google Calendar API
Next, do this
Trigger Incident with the PagerDuty API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜

Trusted by 500,000+ developers from startups to Fortune 500 companies

Adyen logo
Brex logo
Carta logo
Checkr logo
Chameleon logo
DevRev logo
LinkedIn logo
Netflix logo
New Relic logo
OnDeck logo
Replicated logo
Scale AI logo
Teamwork logo
Warner Bros. logo
Xendit logo

Developers Pipedream

Getting Started

This integration creates a workflow with a Google Calendar trigger and PagerDuty action. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Select this integration
  2. Configure the New Event Start trigger
    1. Connect your Google Calendar account
    2. Configure timer
    3. Optional- Select a Calendar ID
  3. Configure the Trigger Incident action
    1. Connect your PagerDuty account
    2. Configure Incident Title
    3. Select a Service ID
    4. Optional- Select a Incident Urgency
    5. Optional- Configure Incident Details
    6. Optional- Configure Incident Key
    7. Optional- Select a Escalation Policy ID
    8. Select one or more Assignee IDs
    9. Optional- Configure Incident Conference Bridge Number
    10. Optional- Configure Incident Conference Bridge URL
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger

Details

This integration uses pre-built, source-available components from Pipedream's GitHub repo. These components are developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Trigger

Description:Emit new event when the specified time before the Google Calendar event starts
Version:0.1.5
Key:google_calendar-event-start

Google Calendar Overview

The Google Calendar API gives developers access to Google Calendar data,
allowing them to create their own applications that can read, write, and update
calendar data. With the API, users can integrate their own calendar
applications with Google Calendar, giving them the ability to manage their
calendars in one place. The API also provides the ability to search for events
and create new events.

Possible applications that could be built using the Google Calendar API
include:

  • A calendar application that integrates with Google Calendar, allowing users
    to manage their calendars in one place.
  • A calendar application that allows users to search for events and create new
    events.
  • A to-do list application that integrates with Google Calendar, allowing users
    to see their tasks and events in one place.
  • A reminder application that uses Google Calendar data to remind users of
    upcoming events.

Trigger Code

import common from "../common/common.mjs";
import sampleEmit from "./test-event.mjs";

export default {
  ...common,
  key: "google_calendar-event-start",
  name: "New Event Start",
  description: "Emit new event when the specified time before the Google Calendar event starts",
  version: "0.1.5",
  type: "source",
  dedupe: "unique",
  props: {
    ...common.props({
      useCalendarId: true,
    }),
  },
  methods: {
    ...common.methods,
    getConfig({
      intervalMs, now,
    }) {
      const timeMin = now.toISOString();
      const timeMax = new Date(now.getTime() + intervalMs).toISOString();
      return {
        calendarId: this.calendarId,
        timeMax,
        timeMin,
        singleEvents: true,
        orderBy: "startTime",
      };
    },
    isRelevant(event, {
      intervalMs, now,
    }) {
      const eventStart = event?.start?.dateTime;
      const start = new Date(eventStart);
      const msFromStart = start.getTime() - now.getTime();
      return eventStart && msFromStart > 0 && msFromStart < intervalMs;
    },
  },
  sampleEmit,
};

Trigger Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
Google CalendargoogleCalendarappThis component uses the Google Calendar app.
timer$.interface.timer
Calendar IDcalendarIdstringSelect a value from the drop down menu.

Trigger Authentication

Google Calendar uses OAuth authentication. When you connect your Google Calendar account, Pipedream will open a popup window where you can sign into Google Calendar and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Google Calendar API.

Pipedream requests the following authorization scopes when you connect your account:

emailprofilehttps://www.googleapis.com/auth/calendar.eventshttps://www.googleapis.com/auth/calendar.readonlyhttps://www.googleapis.com/auth/calendar.settings.readonly

About Google Calendar

Scheduling calendar service developed by Google

Action

Description:Trigger an incident. [See the docs here](https://developer.pagerduty.com/api-reference/b3A6Mjc0ODE0MA-create-an-incident)
Version:0.0.2
Key:pagerduty-trigger-incident

PagerDuty Overview

PagerDuty's APIs allow you to integrate the powerful incident response
capabilities of PagerDuty with your own custom applications. With PagerDuty's
APIs, you can build applications to optimize your incident response process,
collaborate with teams more effectively, and analyze data from your incident
response process. Here are some examples of what you can do with PagerDuty's
APIs:

  • Create and manage automated incident response workflows
  • Automatically trigger actions based on incident response events
  • Enable communication between PagerDuty and other third party applications
  • Pull data from your previous incident response processes to identify best
    practices
  • Create custom reporting tools and insights into incident response processes
  • Monitor multiple teams and services at once

Action Code

import constants from "../../common/constants.mjs";
import utils from "../../common/utils.mjs";
import pagerduty from "../../pagerduty.app.mjs";

const {
  reduceProperties,
  emptyStrToUndefined,
  commaSeparatedListToArray,
} = utils;

export default {
  key: "pagerduty-trigger-incident",
  name: "Trigger Incident",
  description: "Trigger an incident. [See the docs here](https://developer.pagerduty.com/api-reference/b3A6Mjc0ODE0MA-create-an-incident)",
  type: "action",
  version: "0.0.2",
  props: {
    pagerduty,
    title: {
      propDefinition: [
        pagerduty,
        "incidentTitle",
      ],
    },
    serviceId: {
      propDefinition: [
        pagerduty,
        "serviceId",
      ],
    },
    urgency: {
      propDefinition: [
        pagerduty,
        "incidentUrgency",
      ],
    },
    bodyDetails: {
      propDefinition: [
        pagerduty,
        "incidentBodyDetails",
      ],
    },
    incidentKey: {
      propDefinition: [
        pagerduty,
        "incidentKey",
      ],
    },
    escalationPolicyId: {
      propDefinition: [
        pagerduty,
        "escalationPolicyId",
      ],
    },
    assigneeIds: {
      type: "string[]",
      label: "Assignee IDs",
      description: "The IDs of the users to assign to the incident. Use a comma-separated list when structured mode is `off` specifying the ids as values. (e.g. `P97DSQO,PWLDHXC,P1M4QLY`)",
      propDefinition: [
        pagerduty,
        "userId",
      ],
    },
    conferenceBridgeNumber: {
      propDefinition: [
        pagerduty,
        "incidentConferenceBridgeNumber",
      ],
    },
    conferenceBridgeUrl: {
      propDefinition: [
        pagerduty,
        "incidentConferenceBridgeUrl",
      ],
    },
  },
  async run({ $ }) {
    const {
      title,
      serviceId,
    } = this;

    const conferenceBridgeNumber = emptyStrToUndefined(this.conferenceBridgeNumber);
    const conferenceBridgeUrl = emptyStrToUndefined(this.conferenceBridgeUrl);
    const escalationPolicyId = emptyStrToUndefined(this.escalationPolicyId);
    const bodyDetails = emptyStrToUndefined(this.bodyDetails);
    const urgency = emptyStrToUndefined(this.urgency);
    const incidentKey = emptyStrToUndefined(this.incidentKey);
    const assigneeIds = commaSeparatedListToArray(this.assigneeIds);

    const initialProps = {
      type: constants.INCIDENT_TYPE,
      title,
      service: {
        id: serviceId,
        type: constants.REFERENCE.SERVICE,
      },
    };

    const additionalProps = {
      urgency,
      incident_key: incidentKey,
      body: [
        {
          type: constants.INCIDENT_BODY_TYPE,
          details: bodyDetails,
        },
        bodyDetails,
      ],
      assignments: [
        assigneeIds?.map((id) => ({
          assignee: {
            id,
            type: constants.REFERENCE.USER,
          },
        })),
        assigneeIds?.length && !escalationPolicyId,
      ],
      escalation_policy: [
        {
          id: escalationPolicyId,
          type: constants.REFERENCE.ESCALATION_POLICY,
        },
        escalationPolicyId,
      ],
      conference_bridge: [
        {
          conference_number: conferenceBridgeNumber,
          conference_url: conferenceBridgeUrl,
        },
        conferenceBridgeNumber || conferenceBridgeUrl,
      ],
    };

    const toCreate = reduceProperties({
      initialProps,
      additionalProps,
    });

    const { incident } = await this.pagerduty.createIncident({
      $,
      data: {
        incident: toCreate,
      },
    });

    $.export("$summary", `Incident ${incident.summary} has been ${incident.status}`);

    return incident;
  },
};

Action Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI.

LabelPropTypeDescription
PagerDutypagerdutyappThis component uses the PagerDuty app.
Incident Titletitlestring

A succinct description of the nature, symptoms, cause, or effect of the incident.

Service IDserviceIdstringSelect a value from the drop down menu.
Incident UrgencyurgencystringSelect a value from the drop down menu:{ "label": "High", "value": "high" }{ "label": "Low", "value": "low" }
Incident DetailsbodyDetailsstring

Additional incident details.

Incident KeyincidentKeystring

A string which identifies the incident. Sending subsequent requests referencing the same service and with the same Incident Key will result in those requests being rejected if an open incident matches that Incident Key.

Escalation Policy IDescalationPolicyIdstringSelect a value from the drop down menu.
Assignee IDsassigneeIdsstring[]Select a value from the drop down menu.
Incident Conference Bridge NumberconferenceBridgeNumberstring

The phone number of the conference call for the conference bridge. Phone numbers should be formatted like +1 415-555-1212,,,,1234#, where a comma (,) represents a one-second wait and pound (#) completes access code input.

Incident Conference Bridge URLconferenceBridgeUrlstring

An URL for the conference bridge. This could be a link to a web conference or Slack channel.

Action Authentication

PagerDuty uses OAuth authentication. When you connect your PagerDuty account, Pipedream will open a popup window where you can sign into PagerDuty and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any PagerDuty API.

Pipedream requests the following authorization scopes when you connect your account:

About PagerDuty

Real-Time Operations and Incident Response

More Ways to Connect PagerDuty + Google Calendar

Acknowledge Incident with PagerDuty API on New or Updated Event (Instant) from Google Calendar API
Google Calendar + PagerDuty
 
Try it
Acknowledge Incident with PagerDuty API on Event Cancelled from Google Calendar API
Google Calendar + PagerDuty
 
Try it
Acknowledge Incident with PagerDuty API on Event Ended from Google Calendar API
Google Calendar + PagerDuty
 
Try it
Acknowledge Incident with PagerDuty API on Event Search from Google Calendar API
Google Calendar + PagerDuty
 
Try it
Acknowledge Incident with PagerDuty API on Event Start from Google Calendar API
Google Calendar + PagerDuty
 
Try it
New Event Start from the Google Calendar API

Emit new event when the specified time before the Google Calendar event starts

 
Try it
New Upcoming Event Alert from the Google Calendar API

Emit new event based on a time interval before an upcoming event in the calendar. This source uses Pipedream's Task Scheduler. See the documentation for more information and instructions for connecting your Pipedream account.

 
Try it
New Created or Updated Event (Instant) from the Google Calendar API

Emit new event when a Google Calendar events is created or updated (does not emit cancelled events)

 
Try it
New Event Created from the Google Calendar API

Emit new event when a Google Calendar event is created

 
Try it
New Calendar Created from the Google Calendar API

Emit new event when a calendar is created.

 
Try it
Add Quick Event with the Google Calendar API

Create a quick event to the Google Calendar. See the documentation

 
Try it
Create Event with the Google Calendar API

Create an event to the Google Calendar. See the documentation

 
Try it
Delete an Event with the Google Calendar API

Delete an event to the Google Calendar. See the documentation

 
Try it
List Calendars with the Google Calendar API

Retrieve a list of calendars from Google Calendar. See the documentation

 
Try it
List Events with the Google Calendar API

Retrieve a list of event from the Google Calendar. See the documentation

 
Try it

Explore Other Apps

1
-
12
of
1400+
apps by most popular

HTTP / Webhook
HTTP / Webhook
Get a unique URL where you can send HTTP or webhook requests
Node
Node
Anything you can do with Node.js, you can do in a Pipedream workflow. This includes using most of npm's 400,000+ packages.
Schedule
Schedule
Trigger workflows on an interval or cron schedule.
Beta
Python
Python
Anything you can do in Python can be done in a Pipedream Workflow. This includes using any of the 350,000+ PyPi packages available in your Python powered workflows.
Beta
Data Stores
Data Stores
Use Pipedream Data Stores to manage state throughout your workflows.
Telegram Bot
Telegram Bot
Telegram is a cloud-based instant messaging and voice over IP service
OpenAI (ChatGPT)
OpenAI (ChatGPT)
OpenAI is an AI research and deployment company with the mission to ensure that artificial general intelligence benefits all of humanity. They are the makers of popular apps like ChatGPT and DALL·E 2.
Google Sheets
Google Sheets
With Google Sheets, you can create, edit, and collaborate wherever you are
Discord
Discord
Use this app to create a Discord source that emits messages from your guild to a Pipedream workflow.
GitHub
GitHub
Where the world builds software. Millions of developers and companies build, ship, and maintain their software on GitHub—the largest and most advanced development platform in the world.
Formatting
Formatting
Pre-built actions to make formatting and manipulating data within your workflows easier.
Slack
Slack
Slack is a channel-based messaging platform. With Slack, people can work together more effectively, connect all their software tools and services, and find the information they need to do their best work — all within a secure, enterprise-grade environment.