🎉 Pipedream raises $20M Series A 🎉
Read the blog post and TC Techcrunch article.
← ActiveCampaign + Google Sheets integrations

Add Single Row with Google Sheets APIon New Automation Webhook from ActiveCampaign API

Pipedream makes it easy to connect APIs for Google Sheets, ActiveCampaign and 700+ other apps remarkably fast.

Trigger workflow on
New Automation Webhook from the ActiveCampaign API
Next, do this
Add Single Row with the Google Sheets API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

This integration creates a workflow with a ActiveCampaign trigger and Google Sheets 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 Automation Webhook trigger
    1. Connect your ActiveCampaign account
    2. Configure timer
    3. Optional- Select one or more Automations
  3. Configure the Add Single Row action
    1. Connect your Google Sheets account
    2. Optional- Select a Drive
    3. Select a Spreadsheet
    4. Select a Sheet Name
    5. Select a Does the first row of the sheet have headers?
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger


This integration uses pre-built, open source 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.


Description:Emit new event each time an automation sends out webhook data.

Trigger Code

import activecampaign from "../../activecampaign.app.mjs";
import common from "../common/base.mjs";

export default {
  name: "New Automation Webhook",
  key: "activecampaign-new-automation-webhook",
  description: "Emit new event each time an automation sends out webhook data.",
  version: "0.0.4",
  type: "source",
  dedupe: "unique",
  props: {
    timer: {
      type: "$.interface.timer",
      default: {
        intervalSeconds: 60 * 15,
    automations: {
      propDefinition: [
  methods: {
    isWatchedAutomation(automation) {
      return (
        this.automations?.length === 0 ||
    isAutomationRelevant(automation) {
      if (!this.isWatchedAutomation(automation)) {
        return false;

      const entered = this.db.get(automation.id) || 0; // number of times automation has run

      if (parseInt(automation.entered) <= entered) {
        return false;

      this.db.set(automation.id, parseInt(automation.entered));

      return true;
    getMeta(automation) {
      return {
        id: `${automation.id}${automation.entered}`,
        summary: automation.name,
        ts: Date.now(),
  async run() {
    let resources = [];
    let offset = 0;
    let total = 1;

    do {
      const response =
        await this.activecampaign.paginateResources({
          requestFn: this.activecampaign.listAutomations,
          requestArgs: {
            params: {
          resourceName: "automations",
          mapper: (resource) => resource,

      const { options: nextResources } = response;
        offset, total,
      } = response.context);

      resources = resources.concat(nextResources);

      resources.forEach((resource) => {
        if (this.isAutomationRelevant(resource)) {
          this.$emit(resource, this.getMeta(resource));

    } while (resources.length < total);

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.
ActiveCampaignactivecampaignappThis component uses the ActiveCampaign app.
N/Adb$.service.dbThis component uses $.service.db to maintain state between component invocations.
Automationsautomationsstring[]Select a value from the drop down menu.

Trigger Authentication

ActiveCampaign uses API keys for authentication. When you connect your ActiveCampaign account, Pipedream securely stores the keys so you can easily authenticate to ActiveCampaign APIs in both code and no-code steps.

You can find your Base URL and API Key in your Developer Settings in your account. See the ActiveCampaign API docs for more info.

About ActiveCampaign

Email marketing, marketing automation, and CRM tools


Description:Add a single row of data to Google Sheets

Action Code

import googleSheets from "../../google_sheets.app.mjs";
import { ConfigurationError } from "@pipedream/platform";

export default {
  key: "google_sheets-add-single-row",
  name: "Add Single Row",
  description: "Add a single row of data to Google Sheets",
  version: "2.0.7",
  type: "action",
  props: {
    drive: {
      propDefinition: [
    sheetId: {
      propDefinition: [
        (c) => ({
          driveId: googleSheets.methods.getDriveId(c.drive),
      description: "",
      withLabel: true,
    sheetName: {
      propDefinition: [
        (c) => ({
          sheetId: c.sheetId?.value || c.sheetId,
      description: "",
    hasHeaders: {
      type: "string",
      label: "Does the first row of the sheet have headers?",
      description: "If the first row of your document has headers we'll retrieve them to make it easy to enter the value for each column.",
      options: [
      reloadProps: true,
  async additionalProps() {
    const sheetId = this.sheetId?.value || this.sheetId;
    const props = {};
    if (this.hasHeaders === "Yes") {
      const { values } = await this.googleSheets.getSpreadsheetValues(sheetId, `${this.sheetName}!1:1`);
      if (!values[0]?.length) {
        throw new ConfigurationError("Cound not find a header row. Please either add headers and click \"Refresh fields\" or adjust the action configuration to continue.");
      for (let i = 0; i < values[0]?.length; i++) {
        props[`col_${i.toString().padStart(4, "0")}`] = {
          type: "string",
          label: values[0][i],
          optional: true,
    } else if (this.hasHeaders === "No") {
      props.myColumnData = {
        type: "string[]",
        label: "Values",
        description: "Provide a value for each cell of the row. Google Sheets accepts strings, numbers and boolean values for each cell. To set a cell to an empty value, pass an empty string.",
    return props;
  async run({ $ }) {
    const sheetId = this.sheetId?.value || this.sheetId;
    let cells;
    if (this.hasHeaders === "Yes") {
      // TODO: If we could create a variable using this.allColumns in additionalProps, we dont need
      // to call getSpreadsheetValues here again.
      const { values: rows } = await this.googleSheets.getSpreadsheetValues(sheetId, `${this.sheetName}!1:1`);
      const [
      ] = rows;
      cells = headers
        .map((_, i) => `col_${i.toString().padStart(4, "0")}`)
        .map((column) => this[column] ?? "");
    } else {
      cells = this.googleSheets.sanitizedArray(this.myColumnData);

    // validate input
    if (!cells || !cells.length) {
      throw new Error("Please enter an array of elements in `Cells / Column Values`.");
    } else if (!Array.isArray(cells)) {
      throw new Error("Cell / Column data is not an array. Please enter an array of elements in `Cells / Column Values`.");
    } else if (Array.isArray(cells[0])) {
      throw new Error("Cell / Column data is a multi-dimensional array. A one-dimensional is expected. If you're trying to send multiple rows to Google Sheets, search for the action to add multiple rows to Sheets.");

    const {
    } = this.googleSheets.arrayValuesToString(cells);

    const data = await this.googleSheets.addRowsToSheet({
      spreadsheetId: sheetId,
      range: this.sheetName,
      rows: [

    let summary = `Added 1 row to [${this.sheetId?.label || this.sheetId} (${data.updatedRange})](https://docs.google.com/spreadsheets/d/${sheetId}).`;
    if (convertedIndexes.length > 0) {
      summary += " We detected something other than a string/number/boolean in at least one of the fields and automatically converted it to a string.";
    $.export("$summary", summary);

    return data;

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.

Google SheetsgoogleSheetsappThis component uses the Google Sheets app.
DrivedrivestringSelect a value from the drop down menu.
SpreadsheetsheetIdstringSelect a value from the drop down menu.
Sheet NamesheetNamestringSelect a value from the drop down menu.
Does the first row of the sheet have headers?hasHeadersstringSelect a value from the drop down menu:YesNo

Action Authentication

Google Sheets uses OAuth authentication. When you connect your Google Sheets account, Pipedream will open a popup window where you can sign into Google Sheets 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 Sheets API.

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


About Google Sheets

With Google Sheets, you can create, edit, and collaborate wherever you are

More Ways to Connect Google Sheets + ActiveCampaign