# New Chatter Feed Comment (Instant or Polling) — Salesforce

> Emit new events for each Chatter FeedComment (reply) created in Salesforce, polling FeedComment via SOQL on CreatedDate. Use this to react to comments on Chatter posts, since Chatter activity does not update the parent record's…

- Key: `salesforce_rest_api-new-feed-comment`
- Type: Trigger (Polling)
- Version: 0.0.6
- App: Salesforce (`salesforce_rest_api`) — https://pipedream.com/apps/salesforce-rest-api.md
- This page (HTML): https://pipedream.com/apps/salesforce-rest-api/triggers/new-feed-comment
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/salesforce_rest_api/sources/new-feed-comment/new-feed-comment.mjs

## Description

Emit new events for each Chatter FeedComment (reply) created in Salesforce, polling `FeedComment` via SOQL on `CreatedDate`. Use this to react to comments on Chatter posts, since Chatter activity does not update the parent record's `LastModifiedDate`. The payload includes both `ParentId` (a polymorphic reference to the feed's parent - either a record feed, e.g. a Case ID starting with `500`, or a User feed) and `FeedItemId` (the ID of the FeedItem the comment belongs to) - these are distinct fields; do not confuse them. Set `parentObjectType` to a parent object API name (e.g. `Case`) to only emit comments whose parent record is of that type. Set `excludeSelf` to `true` to drop comments authored by the connected integration user. Note: querying FeedComment without a parent filter requires the `View All Data` permission on the connected user. Attempts instant delivery via webhook and falls back to timer polling automatically. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_feedcomment.htm)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `timer` | `$.interface.timer` | Yes | The timer is only used as a fallback if instant event delivery (webhook) is not available. |
| `parentObjectType` | `string` | No | Optional. Only emit comments whose parent record is of this Salesforce SObject API name, e.g. Case (traversal of the polymorphic FeedComment.ParentId). Enforced on both delivery paths: AND Parent.Type = '<value>' in the polling SOQL, and the parent's Salesforce ID key prefix on instant (webhook) deliveries. Leave blank to emit comments on any parent object (requires View All Data permission). |
| `excludeSelf` | `boolean` | No | Optional. When true, appends AND CreatedById != '<authenticatedUserId>' to filter out comments created by the connected user. The user ID is resolved at runtime via the userinfo endpoint and cached in db. |

## Returns

Events emitted by Salesforce.

## Run it

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const deployed = await pd.triggers.deploy({
  id: "salesforce_rest_api-new-feed-comment",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    salesforce_rest_api: { authProvisionId: "apn_xxxxxxx" },
    timer: { "intervalSeconds": 900 },
    parentObjectType: "Parent Object Type",
  },
  webhookUrl: "https://example.com/webhooks/salesforce-rest-api",
})

console.log(deployed.id)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/triggers/deploy \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "salesforce_rest_api-new-feed-comment",
    "webhook_url": "https://example.com/webhooks/salesforce-rest-api",
    "configured_props": {
      "salesforce_rest_api": { "authProvisionId": "apn_xxxxxxx" },
      "timer": { "intervalSeconds": 900 },
      "parentObjectType": "Parent Object Type"
    }
  }'
```

**MCP**

MCP servers expose Salesforce actions as on-demand tools.

New Chatter Feed Comment (Instant or Polling) is an event source, so your application deploys it with the Connect SDK or API and then either receives each event at a webhook URL or retrieves events on demand with the trigger events API.

## Event delivery

Every event is sent to the HTTP endpoint you choose when you deploy the source. Or: no webhook required — your app or agent can fetch recent events from the [trigger events API](https://pipedream.com/docs/connect/api-reference/list-trigger-events.md) instead.

---

- App: https://pipedream.com/apps/salesforce-rest-api.md · All apps: https://pipedream.com/apps
