← Square + Asana integrations

Search Projects with Asana API on New Customer Created from Square API

Pipedream makes it easy to connect APIs for Asana, Square and 2,500+ other apps remarkably fast.

Trigger workflow on
New Customer Created from the Square API
Next, do this
Search Projects with the Asana API
No credit card required
Intro to Pipedream
Watch us build a workflow
Watch us build a workflow
8 min
Watch now ➜

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

Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo
Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo

Developers Pipedream

Getting Started

This integration creates a workflow with a Square trigger and Asana 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 Customer Created trigger
    1. Connect your Square account
    2. Configure timer
  3. Configure the Search Projects action
    1. Connect your Asana account
    2. Optional- Configure Name
    3. Optional- Select a Workspace
    4. Optional- Configure Archived
  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 for every new customer created. [See the docs](https://developer.squareup.com/reference/square/customers-api/list-customers)
Version:0.0.3
Key:square-new-customer-created

Square Overview

The Square API opens up a realm of possibilities for merchants to effortlessly manage their sales, inventory, customers, and payments. With Pipedream, you can automate actions based on events in Square, such as new transactions, updated orders, or customer profile changes. Craft custom workflows that react in real-time, sync data across platforms, or streamline reporting. Through Pipedream's serverless platform, you can connect Square with countless other apps without writing extensive code, turning manual tasks into automated, efficient processes.

Trigger Code

import base from "../common/base-polling.mjs";
import constants from "../common/constants.mjs";

export default {
  ...base,
  key: "square-new-customer-created",
  name: "New Customer Created",
  description: "Emit new event for every new customer created. [See the docs](https://developer.squareup.com/reference/square/customers-api/list-customers)",
  type: "source",
  version: "0.0.3",
  dedupe: "unique",
  hooks: {
    ...base.hooks,
    async deploy() {
      console.log(`Retrieving at most last ${constants.MAX_HISTORICAL_EVENTS} objects...`);
      const { customers } = await this.square.listCustomers({
        params: {
          ...this.getBaseParams(),
        },
      });
      if (!(customers?.length > 0)) {
        return;
      }
      this._setLastTs(Date.parse(customers[0].created_at));
      customers?.slice(0, constants.MAX_HISTORICAL_EVENTS)
        .reverse()
        .forEach((customer) => this.$emit(customer, this.generateMeta(customer)));
    },
  },
  methods: {
    ...base.methods,
    getBaseParams() {
      return {
        limit: constants.MAX_LIMIT,
        sort_field: "CREATED_AT",
        sort_order: "DESC",
      };
    },
    generateMeta(customer) {
      return {
        id: customer.id,
        summary: `Customer created: ${customer.id}`,
        ts: Date.parse(customer.created_at),
      };
    },
  },
  async run() {
    const lastTs = this._getLastTs();
    let newLastTs;
    let cursor;
    let done = false;

    do {
      const response = await this.square.listCustomers({
        params: {
          ...this.getBaseParams(),
          cursor,
        },
      });
      const { customers } = response;
      if (!(customers?.length > 0)) {
        break;
      }
      if (!newLastTs) {
        newLastTs = Date.parse(customers[0].created_at);
      }
      for (const customer of customers) {
        if (Date.parse(customer.created_at) <= lastTs) {
          done = true;
          break;
        }
        this.emitEvent(customer);
      }
      cursor = response?.cursor;
    } while (cursor && !done);

    this._setLastTs(newLastTs);
  },
};

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
SquaresquareappThis component uses the Square app.
N/Adb$.service.dbThis component uses $.service.db to maintain state between executions.
timer$.interface.timer

Trigger Authentication

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

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

CUSTOMERS_READCUSTOMERS_WRITEPAYMENTS_READPAYMENTS_WRITEORDERS_READORDERS_WRITESUBSCRIPTIONS_READSUBSCRIPTIONS_WRITEITEMS_READITEMS_WRITEINVOICES_READINVOICES_WRITELOYALTY_READLOYALTY_WRITEEMPLOYEES_READEMPLOYEES_WRITEMERCHANT_PROFILE_READBANK_ACCOUNTS_READSETTLEMENTS_READDEVELOPER_APPLICATION_WEBHOOKS_WRITEAPPOINTMENTS_ALL_READAPPOINTMENTS_READ

About Square

Solutions & Tools to Grow Your Business

Action

Description:Finds an existing project. [See the documentation](https://developers.asana.com/docs/get-multiple-projects)
Version:0.2.8
Key:asana-search-projects

Asana Overview

The Asana API taps into the feature-rich project management platform, allowing you to automate tasks, sync data across apps, and enhance team collaboration. With the Asana API on Pipedream, you can create tasks, update project timelines, and trigger workflows from events within Asana—like new tasks or comments—streamlining your project management processes. Pipedream’s serverless platform empowers you to build complex workflows with minimal overhead, integrating Asana with numerous other services to maximize productivity and reduce manual workload.

Action Code

import asana from "../../asana.app.mjs";

export default {
  type: "action",
  key: "asana-search-projects",
  version: "0.2.8",
  name: "Search Projects",
  description: "Finds an existing project. [See the documentation](https://developers.asana.com/docs/get-multiple-projects)",
  props: {
    asana,
    name: {
      label: "Name",
      description: "The name to filter projects on.",
      type: "string",
      optional: true,
    },
    workspace: {
      label: "Workspace",
      description: "The workspace or organization to filter projects on.",
      type: "string",
      optional: true,
      propDefinition: [
        asana,
        "workspaces",
      ],
    },
    archived: {
      label: "Archived",
      description: "Only return projects whose `archived` field takes on the value of this parameter.",
      type: "boolean",
      optional: true,
    },
  },
  async run({ $ }) {
    const {
      name,
      workspace,
      archived,
    } = this;

    const { data: projects } = await this.asana.getProjects({
      params: {
        workspace,
        archived,
      },
      $,
    });

    $.export("$summary", "Successfully retrieved projects");

    if (this.name) return projects.filter((project) => project.name.includes(name));
    else return projects;
  },
};

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
AsanaasanaappThis component uses the Asana app.
Namenamestring

The name to filter projects on.

WorkspaceworkspacestringSelect a value from the drop down menu.
Archivedarchivedboolean

Only return projects whose archived field takes on the value of this parameter.

Action Authentication

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

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

About Asana

Work anytime, anywhere with Asana. Keep remote and distributed teams, and your entire organization, focused on their goals, projects, and tasks with Asana.

More Ways to Connect Asana + Square

Create Customer with Square API on Task Added To Project (Instant) from Asana API
Asana + Square
 
Try it
Create Customer with Square API on Task Completed (Instant) from Asana API
Asana + Square
 
Try it
Create Invoice with Square API on Task Added To Project (Instant) from Asana API
Asana + Square
 
Try it
Create Invoice with Square API on Task Completed (Instant) from Asana API
Asana + Square
 
Try it
Create Order with Square API on Task Added To Project (Instant) from Asana API
Asana + Square
 
Try it
Catalog Item Updated from the Square API

Emit new event every time a catalog item is updated. See the docs

 
Try it
New Booking Created from the Square API

Emit new event for every new booking created. See the docs

 
Try it
New Customer Created from the Square API

Emit new event for every new customer created. See the docs

 
Try it
New Invoice Created from the Square API

Emit new event for every new invoice created. See the docs

 
Try it
New Order Created from the Square API

Emit new event for every new order created. See the docs

 
Try it
Create Customer with the Square API

Creates a new customer for a business. Must provide at least one of the following: Given Name, Family Name, Company Name, Email Address, or Phone Number. See the docs

 
Try it
Create Invoice with the Square API

Creates a draft invoice for an order. You must send (publish) the invoice before Square can process it. See the documentation

 
Try it
Create Order with the Square API

Creates a new order that can include information about products for purchase. See docs here

 
Try it
Send Invoice with the Square API

Publishes the latest version of a specified invoice. See the docs

 
Try it
Add Task To Section with the Asana API

Add a task to a specific, existing section. This will remove the task from other sections of the project. See the documentation

 
Try it

Explore Other Apps

1
-
24
of
2,500+
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.
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.
Pipedream Utils
Pipedream Utils
Utility functions to use within your Pipedream workflows
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 models like ChatGPT, DALL-E, and Whisper.
Premium
Salesforce
Salesforce
Cloud-based customer relationship management (CRM) platform that helps businesses manage sales, marketing, customer support, and other business activities, ultimately aiming to improve customer relationships and streamline operations.
Premium
HubSpot
HubSpot
HubSpot's CRM platform contains the marketing, sales, service, operations, and website-building software you need to grow your business.
Premium
Zoho CRM
Zoho CRM
Zoho CRM is an online Sales CRM software that manages your sales, marketing, and support in one CRM platform.
Premium
Stripe
Stripe
Stripe powers online and in-person payment processing and financial solutions for businesses of all sizes.
Shopify
Shopify
Shopify is a complete commerce platform that lets anyone start, manage, and grow a business. You can use Shopify to build an online store, manage sales, market to customers, and accept payments in digital and physical locations.
Premium
WooCommerce
WooCommerce
WooCommerce is the open-source ecommerce platform for WordPress.
Premium
Snowflake
Snowflake
A data warehouse built for the cloud
Premium
MongoDB
MongoDB
MongoDB is an open source NoSQL database management program.
Supabase
Supabase
Supabase is an open source Firebase alternative.
MySQL
MySQL
MySQL is an open-source relational database management system.
PostgreSQL
PostgreSQL
PostgreSQL is a free and open-source relational database management system emphasizing extensibility and SQL compliance.
Premium
AWS
AWS
Amazon Web Services (AWS) offers reliable, scalable, and inexpensive cloud computing services.
Premium
Twilio SendGrid
Twilio SendGrid
Send marketing and transactional email through the Twilio SendGrid platform with the Email API, proprietary mail transfer agent, and infrastructure for scalable delivery.
Amazon SES
Amazon SES
Amazon SES is a cloud-based email service provider that can integrate into any application for high volume email automation
Premium
Klaviyo
Klaviyo
Email Marketing and SMS Marketing Platform
Premium
Zendesk
Zendesk
Zendesk is award-winning customer service software trusted by 200K+ customers. Make customers happy via text, mobile, phone, email, live chat, social media.
Premium
ServiceNow
ServiceNow
The smarter way to workflow
Notion
Notion
Notion is a new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team.
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.