← 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 IDproductId(String) — Tremendous product ID (or leave blank for AI pick)message(String) — Card messagecampaignId(String, optional) — Link to a CRMGift Campaign
Outputs:
giftId(String) — CRMGift_Gift__c record IDstatus(String) — "Sent" or error message
CheckBudget
Validate spending before triggering a gift.
Inputs:
userId(String) — The sending user's IDamount(Decimal) — Gift cost
Outputs:
allowed(Boolean) — Whether the send is within budgetremainingBudget(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 IDsproductNames(List<String>) — Product names
Example: Closed-Won Auto-Gift
- Create a Record-Triggered Flow on Opportunity
- Set entry criteria: Stage equals "Closed Won"
- Add a Get Records element to find the primary Contact
- Add an Action element → CRMGift: GetRecommendation
- Add an Action element → CRMGift: CheckBudget
- Add a Decision element → If budget allowed
- Add an Action element → CRMGift: SendGift