Write Agent Results Back to Your CRM
The most useful agents don't just decide — they put the result where your team already works. In an AI Agent flow's Act step, you can write back to Salesforce or HubSpot so a health field, a risk flag, or a next step shows up on the record your AE or CSM already opens. This guide covers the functions to use and how to do it safely.
The CRM functions
Use these in a CALL step (or as tools on an AGENT step). Full signatures are in the Functions reference.
| Goal | Function |
|---|---|
| Read a Salesforce record before deciding | salesforce.read_record |
| Update a field on a Salesforce record | salesforce.update_record |
| Create a Salesforce record | salesforce.create_record |
| Read a HubSpot record | hubspot.read_record |
| Update a field on a HubSpot company, deal, or contact | hubspot.update_record |
| Anything the above don't cover (e.g. enroll a contact in a sequence) | data_connection.request — an authenticated call to the CRM's API through your connection |
Example: surface churn risk in the CRM
Pair this with the Churn-Risk Watch agent: after the agent decides an account is at risk, its Act step calls hubspot.update_record (or salesforce.update_record) to set a Health or Risk property on the company or deal. Now the risk is visible in your sales team's CRM views and reports — and, with the HubSpot app card, right on the record.
Do it safely
Writing to the CRM is an Auto action — it changes a system of record — so treat it deliberately:
- Start with internal fields (a FunnelStory-owned health/risk property), not customer-facing ones.
- Read before you write when the update depends on current state (
*.read_record). - Test on one account before you publish, and check the record updated as expected.
- Prefer update over create unless you genuinely need a new record.
Build it
- Connect your CRM — see Salesforce or HubSpot.
- In the flow, add a CALL step with the CRM function, and map the record ID and the fields to write (usually from an earlier AGENT step's output).
- Test the flow on a recent account, then publish.
Related
- Functions reference — the CRM function signatures.
- Build a Churn-Risk Watch Agent — a detect→investigate→act agent to write results from.
- HubSpot app card — show FunnelStory data on the HubSpot record.