Skip to main content

Overview

This document is intended for developers who want to author and edit Pipedream Actions. After completing this quickstart, you’ll understand how to:
  • Develop Pipedream components
  • Publish private actions and use them in workflows
  • Use props to capture user input
  • Update an action
  • Use npm packages
  • Use Pipedream managed auth for a 3rd party app

Prerequisites

NOTE: See the CLI reference for detailed usage and examples beyond those covered below.

Walkthrough

We recommend that you complete the examples below in order. hello world! (~5 minutes)
  • Develop a hello world! action
  • Publish it (private to your account) using the Pipedream CLI
  • Add it to a workflow and run it
hello [name]! (~5 minutes)
  • Capture user input using a string prop
  • Publish a new version of your action
  • Update the action in your workflow
Use an npm Package (~5 mins)
  • Require the axios npm package
  • Make a simple API request
  • Export data returned by the API from your action
Use Managed Auth (~10 mins)
  • Use Pipedream managed OAuth for GitHub with the octokit npm package
  • Connect your GitHub account to the action in a Pipedream workflow
  • Retrieve details for a repo and return them from the action

hello world!

The following code represents a simple component that can be published as an action (learn more about the component structure). When used in a workflow, it will export hello world! as the return value for the step.
export default {
  name: "Action Demo",
  description: "This is a demo action",
  key: "action_demo",
  version: "0.0.1",
  type: "action",
  props: {},
  async run() {
    return `hello world!`;
  },
};
To get started, save the code to a local .js file (e.g., action.js) and run the following CLI command:
pd publish action.js
The CLI will publish the component as an action in your account with the key action_demo. The key must be unique across all components in your account (sources and actions). If it’s not unique, the existing component with the matching key will be updated. The CLI output should look similar to this:
sc_v4iaWB  Action Demo                             0.0.1    just now             action_demo
To test the action:
  1. Open Pipedream in your browser
  2. Create a new workflow with a Schedule trigger
  3. Click the + button to add a step to your workflow
  4. Click on My Actions and then select the Action Demo action to add it to your workflow.