← Back to Documentation

Flow Builder Automation

Invocable actions for Salesforce Flow.

Available Invocable Actions

CRMGift provides three invocable Apex actions for use in Salesforce Flows:

SendGift

Trigger a gift send from any Flow.

Inputs:

  • recipientId (String) — Contact or Lead record ID
  • productId (String) — Tremendous product ID (or leave blank for AI pick)
  • message (String) — Card message
  • campaignId (String, optional) — Link to a CRMGift Campaign

Outputs:

  • giftId (String) — CRMGift_Gift__c record ID
  • status (String) — "Sent" or error message

CheckBudget

Validate spending before triggering a gift.

Inputs:

  • userId (String) — The sending user's ID
  • amount (Decimal) — Gift cost

Outputs:

  • allowed (Boolean) — Whether the send is within budget
  • remainingBudget (Decimal) — Remaining monthly budget

GetRecommendation

Get AI-suggested products for a recipient.

Inputs:

  • recordId (String) — Opportunity, Contact, or Lead ID

Outputs:

  • productIds (List<String>) — Top 3 recommended product IDs
  • productNames (List<String>) — Product names

Example: Closed-Won Auto-Gift

  1. Create a Record-Triggered Flow on Opportunity
  2. Set entry criteria: Stage equals "Closed Won"
  3. Add a Get Records element to find the primary Contact
  4. Add an Action element → CRMGift: GetRecommendation
  5. Add an Action element → CRMGift: CheckBudget
  6. Add a Decision element → If budget allowed
  7. Add an Action element → CRMGift: SendGift