> ## Documentation Index
> Fetch the complete documentation index at: https://docs.influship.com/llms.txt
> Use this file to discover all available pages before exploring further.

# n8n

> Add Influship as a step in any n8n workflow — usable as a tool by n8n AI Agents.

The Influship n8n community node adds **13 operations across 4 resources** (Creator, Profile, Post, YouTube) to your n8n instance. It's a single declarative node — pick a resource, pick an operation, fill in the parameters, run.

The node is marked `usableAsTool: true`, so n8n AI Agents can call any of its operations as a tool.

There are no trigger nodes — Influship is an enrichment API. Your workflow is started by something *you* track (an Instagram Business webhook, a Postgres trigger, an inbound email), and Influship runs as a step inside it.

## Install

<Tabs>
  <Tab title="n8n Cloud / self-hosted (community node)">
    1. Open **Settings → Community Nodes**.
    2. Click **Install** and enter `@influship/n8n`.
    3. Accept the risks of running a community node.
    4. Refresh the editor — the **Influship** node appears in the actions panel.
  </Tab>

  <Tab title="Local development (link from source)">
    Clone the monorepo and link the package into your local n8n install:

    ```bash theme={null}
    cd integrations/n8n
    pnpm build
    npm link
    cd ~/.n8n/custom
    npm link @influship/n8n
    ```

    Restart n8n. The node appears under **Influship** in the actions panel.
  </Tab>
</Tabs>

## Authenticate

<Steps>
  <Step title="Get your API key">
    From the [developer dashboard](https://developers.influship.com/api/keys). Keys start with `inf_`.
  </Step>

  <Step title="Create the credential">
    In n8n, go to **Credentials → New**, search **Influship API**, paste your key, and click **Save**.
  </Step>

  <Step title="Test">
    n8n hits `/v1/creators/autocomplete` (0.05 credits) to verify the key works. If you see a green check, you're connected.
  </Step>
</Steps>

## Capabilities

### Resource: Creator

| Operation           | Endpoint                                | Cost          |
| ------------------- | --------------------------------------- | ------------- |
| **Search**          | `POST /v1/search`                       | 25 + 2/result |
| **Find**            | `POST /v1/search` (top 1)               | 25 + 2        |
| **Get**             | `GET /v1/creators/:id?include=profiles` | 0.1           |
| **Find Lookalikes** | `POST /v1/creators/lookalike`           | 1.5/result    |
| **Score Match**     | `POST /v1/creators/match`               | \~10          |

### Resource: Profile

| Operation          | Endpoint                                  | Cost        |
| ------------------ | ----------------------------------------- | ----------- |
| **Get**            | `GET /v1/profiles/instagram/:username`    | 0.1         |
| **Lookup (Batch)** | `POST /v1/profiles/lookup`                | 0.1/profile |
| **Get Live**       | `GET /v1/raw/instagram/profile/:username` | 0.5         |

### Resource: Post

| Operation               | Endpoint                    | Cost      |
| ----------------------- | --------------------------- | --------- |
| **Get Creator's Posts** | `GET /v1/posts?creator_id=` | 0.05/post |

### Resource: YouTube

| Operation                   | Endpoint                                          | Cost       |
| --------------------------- | ------------------------------------------------- | ---------- |
| **Get Channel**             | `GET /v1/raw/youtube/channel/:handle`             | 0.5        |
| **Get Transcript**          | `GET /v1/raw/youtube/transcript/:video_id`        | 0.5        |
| **Get Channel Transcripts** | `GET /v1/raw/youtube/channel-transcripts/:handle` | 0.5/result |
| **Search**                  | `GET /v1/raw/youtube/search`                      | 0.5/result |

All costs are in credits. **1 credit = \$0.01**.

## Build your first workflow

### Recipe — Enrich a Postgres row, fan out to Slack

A new lead lands in your `creators_to_review` table; n8n looks up their Instagram profile, scores them against a stored brief, and posts a Slack summary if the score clears a threshold.

<Steps>
  <Step title="Trigger: Postgres Trigger">
    Watch the `creators_to_review` table for new rows.
  </Step>

  <Step title="Action: Influship — Profile → Get">
    Map `{{$json.handle}}` to **Instagram Username**. Returns follower count, engagement, verified status.
  </Step>

  <Step title="Action: Influship — Creator → Score Match">
    Pass `{{$json.id}}` (the creator ID you got from the profile lookup, hydrated via Get if needed) and your brief text. Returns `match_score` (0–1) and `decision`.
  </Step>

  <Step title="IF node: decision === 'good'">
    Branch on the n8n IF node.
  </Step>

  <Step title="Action: Slack — Post Message">
    On the true branch, post `{{$json.creator.username}} scored {{$json.match_score}}: {{$json.reasons[0].text}}` to `#marketing-leads`.
  </Step>
</Steps>

### Use it from an AI Agent

The node is `usableAsTool: true`, so any n8n AI Agent (LangChain, OpenAI Tools, etc.) can call Influship operations to answer creator-related questions in a conversation:

```
User: Find me three fitness creators with audiences in the UK under 200K followers.

Agent (internal): Calls Influship.Creator.Search with query="fitness creators in the UK"
                  filters via the natural-language query (UK, <200K followers).
                  Returns ranked results.

Agent (reply): "I found Jane Doe (124K, 5.8% ER), …"
```

Add the **Influship** node as a tool on your AI Agent node; the agent picks operations based on the user's request. Bound by your account's credit limits — keep an eye on cost if the agent gets chatty.

## Cost expectations

n8n's polling cadence and "Retry on Fail" defaults mean per-event cost matters more than throughput. A rough budget:

| Workflow                                 | Per-event cost  | At 100/day                     | At 1,000/day        |
| ---------------------------------------- | --------------- | ------------------------------ | ------------------- |
| Postgres → enrich → Slack (recipe above) | \~10.2 credits  | \$10/day                       | \$100/day           |
| Bulk enrich via Lookup Profiles          | 0.1/handle      | \$1 per 100 handles            | \$10 per 1k handles |
| AI Agent — exploratory chat              | varies (5–100+) | depends on agent talkativeness |                     |

## Troubleshooting

<AccordionGroup>
  <Accordion title="Authentication failed. Please reconnect your Influship credential.">
    Your API key was revoked or rotated. Go to **Credentials → Influship API → Reconnect** and paste a fresh key from the [developer dashboard](https://developers.influship.com/api/keys).
  </Accordion>

  <Accordion title="Rate limit hit (HTTP 429)">
    n8n's per-node **Retry On Fail** setting handles this automatically. The `Retry-After` header on the 429 response tells n8n how long to wait. If you're seeing it constantly, your account is at its tier's rate limit — email [support@influship.com](mailto:support@influship.com).
  </Accordion>

  <Accordion title="Live data temporarily unavailable (HTTP 503)">
    Live data nodes can return `503 service_unavailable` when an upstream platform temporarily throttles a scrape. Use **Retry On Fail** and honor `Retry-After`; this is not your API key hitting its Influship account rate limit.
  </Accordion>

  <Accordion title="&#x22;Cannot read properties of undefined (reading ...)&#x22;">
    Almost always means a previous node returned an empty array and you're accessing `$json[0].x`. Use the IF node or `?? null` to guard.
  </Accordion>

  <Accordion title="Why isn't there an Influship trigger node?">
    Influship doesn't emit real-time events. The node is **enrichment-only** — your workflow is started by something *you* track (a Postgres change, an HTTP webhook, a schedule), and Influship runs as a step inside it. A trigger that fires when we *happen* to re-fetch a creator hours later would create workflows that "missed" real events.
  </Accordion>
</AccordionGroup>

## Support

* Docs: [docs.influship.com](https://docs.influship.com)
* Email: [support@influship.com](mailto:support@influship.com)
* Source: [github.com/Influship/influship](https://github.com/Influship/influship/tree/main/integrations/n8n)
