Skip to main content

Salesforce

RunLLM can help you maintain your Salesforce support platform by automatically responding to your posts. To deploy RunLLM to Salesforce support platform, follow these steps:

  1. Create a RunLLM user. Every post has to be associated with a particular user, so we recommend creating a separate user for RunLLM on your Salesforce instance. Please use the RunLLM logo as the avatar for the user.

  2. Create a Named Credential. This enables outbound HTTP requests without code:

    • Go to Setup → Named Credentials
    • Go to External Credentials
    • Click New
    • Fill in:
      • Label/Name: RunLLM_External_Credential
      • Authentication Protocol: No Authentication
    • Click Save
    • Once created, clck on RunLLM_External_Credential
    • Click New, under Principal
    • Fill in:
      • Parameter Name: RunLLM_Principal
      • Sequence Number: 1
    • Click Save
    • Click New, under Custom Headers
    • Fill in:
      • Name: x-api-key
      • Value: Your RunLLM API Key
      • Sequence Number 1
    • Click Save
    • Go to Setup → Named Credentials
    • Go to Named Credentials
    • Click New
    • Fill in:
      • Label/Name: RunLLM_Named_Credential
      • URL: https://api.runllm.com
      • External Credential: RunLLM_External_Credential
      • Uncheck Generate Authorization Header
    • Click Save
    • Go to Setup → Users
    • Find the Salesforce user
    • Click on the Profile
    • Add RunLLM_External_Credential to the External Credential Principal Access for that profile
  3. Create the Flow:

    • Go to Setup → Flows
    • Click New Flow
    • Choose Record-Triggered Flow
    • Configure the Trigger:
      • Object: Case
      • Trigger When: A record is created
      • Optimize for: Actions and Related Records
    • Click Done
    • Create a new scheduled path:
      • In the flow canvas, click the Start element
      • In the right-hand panel, click + Add Scheduled Paths
      • In the pop-up that appears, click + Add Scheduled Path
      • Fill in:
        • Path Label: RunLLMWebhookPath
        • API Name: auto-fills, or set RunLLMWebhookPath
        • Time Source: When Case is Created
        • Offset Number: 0
        • Offset Unit: Minutes After
      • (Optional) Click Show Advanced Options to add conditions
        • Set Condition Requirements to None if you want all cases to trigger this path
  4. Create the HTTP Callout:

    • In Flow Builder, click + → Action → New HTTP Callout
    • Named Credential: Choose RunLLM_Named_Credential
    • Name: RunLLM_Webhook
    • Click Next
    • Configure HTTP Callout:
      • Method: POST
      • Path: /api/salesforce/webhook
    • Click Next
    • In the Sample JSON Request, paste:
      {
      "caseId": "500gL000006vOLVQA2",
      "subject": "Test Subject",
      "description": "Test description",
      "instanceUrl": "https://yourInstance.salesforce.com"
      }
    • Click Review, then click Next
  5. Create a Variable for the Request:

    • In Flow, click + New Resource
    • Resource Type: Variable
    • API Name: runllmWebhookRequest
    • Data Type: Apex-Defined
    • Apex Class: Select externalService_RunLLM_Webhook_postmethod_body (or similar)
    • Click Done
  6. Assign Values to Request:

    • Click + → Assignment
    • Label: RunLLM Webhook Payload
    • Add these assignments:
      FieldValue
      runllmWebhookRequest.caseId{!$Record.Id}
      runllmWebhookRequest.subject{!$Record.Subject}
      runllmWebhookRequest.description{!$Record.Description}
      runllmWebhookRequest.instanceUrl{!$Api.Partner_Server_URL_540}
    • Click Done
  7. Add the HTTP Action:

    • Click + → Select your new action (SendWebhook)
    • For body, select webhookRequest
    • Click Done
  8. Save & Activate:

    • Click Save → Name your Flow
    • Click Activate
  9. Create a deployment on RunLLM: Go to the RunLLM admin dashboard and navigate to the Config tab for your deployment. Click Add deployment and select Salesforce. During the OAuth approval, please ensure you are signed into your RunLLM user. (This is the user that will create the internal comments.) Follow the steps and click save once you get back to the modal. Then you're done!