← Notion + pCloud integrations

Copy File with pCloud API on New Comment Created from Notion API

Pipedream makes it easy to connect APIs for pCloud, Notion and 2,700+ other apps remarkably fast.

Trigger workflow on
New Comment Created from the Notion API
Next, do this
Copy File with the pCloud 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 Notion trigger and pCloud 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 Comment Created trigger
    1. Connect your Notion account
    2. Configure timer
    3. Configure infoLabel
    4. Select a Page ID
  3. Configure the Copy File action
    1. Connect your pCloud account
    2. Select a File ID
    3. Select a Destination Folder ID
    4. Configure New File Name
    5. Optional- Configure Overwrite?
    6. Optional- Configure Modified Time
    7. Optional- Configure Created Time
  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 a new comment is created in a page or block. [See the documentation](https://developers.notion.com/reference/retrieve-a-comment)
Version:0.0.4
Key:notion-new-comment-created

Notion Overview

Notion's API allows for the creation, reading, updating, and deleting of pages, databases, and their contents within Notion. Using Pipedream's platform, you can build workflows that connect Notion with various other services to automate tasks such as content management, task tracking, and data synchronization. With Pipedream's serverless execution, you can trigger these workflows on a schedule, or by external events from other services, without managing any infrastructure.

Trigger Code

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

export default {
  ...base,
  key: "notion-new-comment-created",
  name: "New Comment Created",
  description: "Emit new event when a new comment is created in a page or block. [See the documentation](https://developers.notion.com/reference/retrieve-a-comment)",
  version: "0.0.4",
  type: "source",
  dedupe: "unique",
  props: {
    ...base.props,
    infoLabel: {
      type: "alert",
      alertType: "info",
      content: "Ensure the selected page is shared with your Pipedream integration to receive events.",
    },
    pageId: {
      propDefinition: [
        base.props.notion,
        "pageId",
      ],
      description: "Select the page to watch for new comments, or provide a page ID",
    },
  },
  methods: {
    ...base.methods,
    generateMeta(comment) {
      const { id } = comment;
      const text = comment.rich_text?.[0]?.plain_text;
      const summary = text
        ? `"${text.length > 40
          ? text.slice(0, 35) + "[...]"
          : text}"`
        : `ID ${id}`;
      return {
        id,
        summary: `New Comment: ${summary}`,
        ts: Date.parse(comment.created_time),
      };
    },
  },
  async run() {
    const lastTs = this.getLastCreatedTimestamp();
    let maxTs = lastTs;
    let cursor;

    do {
      const {
        results, next_cursor: next,
      } = await this.notion._getNotionClient().comments.list({
        block_id: this.pageId,
        start_cursor: cursor,
        page_size: 100,
      });
      if (!results?.length) {
        break;
      }
      for (const comment of results) {
        const ts = Date.parse(comment.created_time);
        if (ts >= lastTs) {
          maxTs = Math.max(ts, maxTs);
          this.$emit(comment, this.generateMeta(comment));
        }
      }
      cursor = next;
    } while (cursor);

    this.setLastCreatedTimestamp(maxTs);
  },
};

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
NotionnotionappThis component uses the Notion app.
N/Adb$.service.dbThis component uses $.service.db to maintain state between executions.
timer$.interface.timer
Page IDpageIdstringSelect a value from the drop down menu.

Trigger Authentication

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

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

About 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.

Action

Description:Copy a file to the specified destination. [See the docs here](https://docs.pcloud.com/methods/file/copyfile.html)
Version:0.0.4
Key:pcloud-copy-file

pCloud Overview

The pCloud API allows for direct interaction with your pCloud account, providing access to files and folders within your cloud storage. With Pipedream, you can automate file management tasks such as uploading, downloading, and synchronizing files. Additionally, you can create workflows to organize your cloud storage, share files with team members, or back up important data from various sources.

Action Code

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

export default {
  ...common,
  key: "pcloud-copy-file",
  name: "Copy File",
  description:
    "Copy a file to the specified destination. [See the docs here](https://docs.pcloud.com/methods/file/copyfile.html)",
  version: "0.0.4",
  type: "action",
  props: {
    ...common.props,
    fileId: {
      propDefinition: [
        pcloud,
        "fileId",
      ],
      description: `Select a **File** to copy.
        \\
        Alternatively, you can provide a custom *File ID*.`,
    },
    toFolderId: {
      propDefinition: [
        pcloud,
        "folderId",
      ],
      label: "Destination Folder ID",
      description: `Select a **Destination Folder** to receive the copied file.
        \\
        Alternatively, you can provide a custom *Folder ID*.`,
    },
    name: {
      propDefinition: [
        pcloud,
        "name",
      ],
      label: "New File Name",
      description: "Name of the destination file.",
    },
    overwrite: {
      propDefinition: [
        pcloud,
        "overwrite",
      ],
    },
    modifiedTime: {
      propDefinition: [
        pcloud,
        "modifiedTime",
      ],
    },
    createdTime: {
      propDefinition: [
        pcloud,
        "createdTime",
      ],
    },
  },
  methods: {
    ...common.methods,
    getSummary() {
      return `Copied file "${this.name}" successfully`;
    },
    async requestMethod() {
      return this.pcloud.copyFile(
        this.fileId,
        this.toFolderId,
        this.name,
        !this.overwrite,
        this.modifiedTime,
        this.createdTime,
      );
    },
  },
};

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
pCloudpcloudappThis component uses the pCloud app.
File IDfileIdintegerSelect a value from the drop down menu.
Destination Folder IDtoFolderIdintegerSelect a value from the drop down menu.
New File Namenamestring

Name of the destination file.

Overwrite?overwriteboolean

If true, and an entry with the same name already exists, it will be overwritten.

Otherwise, an error 2004 will be returned instead.

Modified TimemodifiedTimeinteger

Must be Unix time (seconds).

Created TimecreatedTimeinteger

Must be Unix time (seconds).

Requires Modified Time to be set.

Action Authentication

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

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

About pCloud

Secure encrypted cloud storage

More Ways to Connect pCloud + Notion

Retrieve Block with Notion API on Watch Folder from pCloud API
pCloud + Notion
 
Try it
Retrieve Page with Notion API on Watch Folder from pCloud API
pCloud + Notion
 
Try it
Append Block to Parent with Notion API on Watch Folder from pCloud API
pCloud + Notion
 
Try it
Create Page from Database with Notion API on Watch Folder from pCloud API
pCloud + Notion
 
Try it
Create Page with Notion API on Watch Folder from pCloud API
pCloud + Notion
 
Try it
New Comment Created from the Notion API

Emit new event when a new comment is created in a page or block. See the documentation

 
Try it
New Database Created from the Notion API

Emit new event when a database is created. See the documentation

 
Try it
New or Updated Page in Database from the Notion API

Emit new event when a page is created or updated in the selected database. See the documentation

 
Try it
New Page in Database from the Notion API

Emit new event when a page is created in the selected database. See the documentation

 
Try it
Page or Subpage Updated from the Notion API

Emit new event when the selected page or one of its sub-pages is updated. See the documentation

 
Try it
Append Block to Parent with the Notion API

Append new and/or existing blocks to the specified parent. See the documentation

 
Try it
Create Comment with the Notion API

Create a comment in a page or existing discussion thread. See the documentation

 
Try it
Create Page with the Notion API

Create a page from a parent page. See the documentation

 
Try it
Create Page from Database with the Notion API

Create a page from a database. See the documentation

 
Try it
Duplicate Page with the Notion API

Create a new page copied from an existing page block. See the documentation

 
Try it

Explore Other Apps

1
-
0
of
2,700+
apps by most popular