Skip to main content

Connect n8n to Backstory

Access your Backstory sales intelligence directly in n8n.

The Backstory: You’re using n8n to build an automated workflow that relies on your sales data to trigger actions, enrich records, or streamline repetitive tasks. To make your workflow more useful, you need a way to access your Backstory data without manually exporting it or switching between applications. You connect n8n to Backstory using the MCP integration, allowing your workflow to retrieve relevant sales data and use it alongside other tools and services. With Backstory data available directly in your workflow, you can build more powerful automations that reduce manual work and help your team act on the right information at the right time.


Connect n8n to Backstory to build automated workflows like daily account risk monitoring, opportunity coaching, or CRM chatbots all powered by verified sales intelligence. The MCP Client tool in n8n (added in v1.19.0) lets your AI Agent nodes securely access Backstory sales data.

To connect n8n and Backstory, you will need a n8n instance (cloud or self-hosted v1.19.0 or later) and an active Backstory account with MCP API access enabled.


Obtain Backstory API Credentials

Contact your Backstory administrator, Customer Success Manager, or support@backstory.ai to request API access for your account. You will receive two credentials:

  • Client ID (example format: Yl1JnBI...)

  • Client Secret (example format: 2rT0SWrgR...)

Store these credentials securely. You'll need them for n8n configuration.


Configure Backstory in n8n

  1. In n8n, create a new workflow or open an existing one.

  2. Add an AI Agent node. (Use Claude or OpenAI GPT-4. Claude is recommended for complex sales analysis and strategic insights.)

  3. In the AI Agent node, click Add Tool and select MCP Client.

  4. In the MCP Client configuration, set:

    Connection Name: Backstory MCP Multi-Header

    Authentication: Multiple Headers Auth

  5. Configure three authentication headers:

    Header 1 - Name: PAI-Client-Id | Value: [Your Client ID]

    Header 2 - Name: PAI-Client-Secret | Value: [Your Client Secret]

    Header 3 - Name: Content-Type | Value: application/json

    Important: Header names are case-sensitive. Use exactly as shown: PAI-Client-Id (not PAI-Client-ID or pai-client-id).

  6. Under Allowed HTTP Request Domains, select All or add mcp.people.ai.

  7. Click Save to create the credential.


Configure Your AI Agent

Add a system prompt to your AI Agent that instructs it how to use the Backstory tools. Here's a recommended example:

You are a sales intelligence assistant with access to Backstory CRM data. When users ask about accounts, opportunities, or customer activity: 1) Use Backstory MCP tools to search and retrieve data, 2) Analyze the information and provide strategic insights, 3) Highlight risks, next steps, and key topics, 4) Format responses clearly and actionably.


Test Your Workflow

Trigger your workflow manually or set up a test input.

Try these example queries:

  • "Find the account for [Company Name]"

  • "What are the risks for opportunity [ID]?"

  • "Show me recent activity for [Account Name]"

Check the execution log to verify:

  • MCP tools appear in AI Agent's available tools

  • AI Agent successfully calls Backstory tools

  • Data is returned from Backstory

  • AI provides intelligent analysis of the data


Frequently Asked Questions

I can't find the MCP Client tool in n8n. Why?

The MCP Client tool was added in n8n version 1.19.0. Make sure you're running this version or later. If you're on an older version, update your n8n instance. For self-hosted installations, verify that all required dependencies are properly installed after updating. The MCP Client should appear in the Tools section when configuring an AI Agent node.

Connection failed or server not responding. What should I check?

First, verify the endpoint URL is exactly https://mcp.backstory.ai/mcp (no trailing slash after "mcp"). Then confirm all three headers are configured correctly with exact case-sensitive names: PAI-Client-Id, PAI-Client-Secret, and Content-Type. Common mistakes include typos, wrong case, or extra spaces in credential values. If you're self-hosted, also check that your n8n instance can reach external URLs (firewall/proxy settings).

Authentication failed or invalid credentials error. What's wrong?

Double-check that your Client ID and Client Secret are correct with no extra spaces before or after. Verify you're using MCP-specific credentials (not REST API credentials). These are different types of access. Contact your Backstory support team to confirm your credentials are active and haven't expired. If you recently received new credentials, wait a few minutes for them to propagate through the system before trying again.

The AI Agent isn't using Backstory tools. How do I fix this?

Make your AI Agent prompt more explicit about when to use Backstory tools. For example, add "Use the find_account tool to search for [company]" or "Always query Backstory when asked about account information." Also verify the AI model you're using has function calling capabilities. Both Claude and OpenAI GPT-4 support this. Check that the MCP Client tool is properly connected to the AI Agent node and shows as active.

My workflow times out. What should I do?

Some MCP tools (especially ask_sales_ai_about_account) can take 10-30 seconds to complete. Increase your workflow timeout settings in n8n if needed. For faster responses, use simpler tools like get_account_status instead of the AI-powered analysis tools. If you're processing many accounts, implement error handling and retry logic. For bulk data operations, consider combining the Backstory REST API with MCP tools for better performance.

Is my data secure with this integration?

Yes. Your Backstory data never leaves the secure Backstory environment. n8n workflows only send queries and receive specific responses. The integration uses HTTPS/TLS encryption for all communication. Store your API credentials securely using n8n's built-in credential system (never in workflow code). The integration respects your Backstory permissions, so workflows can only access data your credentials have permission to view. Follow best practices by rotating your Client ID and Secret regularly and limiting workflow access to team members who need it.

Can I combine Backstory MCP with the REST API?

Yes. Use the Backstory Insights Export REST API for bulk data extraction (like getting all opportunities for a team), then use MCP tools for deep intelligence on specific high-priority items. For example: REST API pulls all opportunities closing this quarter → n8n logic calculates risk scores → MCP tools analyze the top 10 high-risk opportunities → n8n formats and sends the report. This hybrid approach combines the efficiency of bulk APIs with the intelligence of AI-powered analysis.

How do I update or disconnect the integration?

To update credentials, go to n8n's Credentials menu, find your Backstory MCP credential, click Edit, update the Client ID and/or Secret, and Save. All workflows using this credential will automatically use the new values. To disconnect, remove or disable the MCP Client tool from your AI Agent nodes, and optionally delete the credential from the Credentials menu. You can reconnect anytime by following the setup steps again with your credentials.


Need Help?

Contact your Customer Success Manager or support@backstory.ai.

Did this answer your question?