Giovanni Cocco logoGiovanni Cocco
Back

AI implementation

How to connect AI to CRM, ERP, WhatsApp and internal systems

Connecting AI to CRM, ERP, WhatsApp and internal systems is not giving the model direct access to everything. Integration needs to transform business capabilities into small, authoritative, observable tools. Thus, AI consults context and performs actions without circumventing existing rules.

Map events and actions

Start with the flow. A client sends a message; the system identifies the account; request and policy consultation; suggests an answer; records the contact; maybe open a task. For each step, define source system, required data, allowed and responsible action.

Create an integration layer

Instead of exposing entire APIs to the model, create specific operations, such as consultar_pedido, registrar_interacao and criar_atividade. Validate types, limits, and rules outside of AI. The model chooses the intention; the code ensures that execution respects the contract.

Use OAuth or service identity with minimal scope. Salesforce documentation shows OAuth as the authentication basis for its APIs. The same principle applies to other systems: credentials should be in the secure layer, never in the prompt.

Prefer events for long processes

Synchronous calls serve quick queries. Processes that depend on multiple systems need queues, idempotence and retries. If the ERP becomes unavailable, the task cannot disappear or be executed twice. Register one identifier per operation and treat each step as state.

Separate context from permission

Finding data does not mean being able to show it. Recovery must respect user, account, area and purpose. An attendant can query order status, but not complete financial data. The agent inherits the process policy, not a generic administrator permission.

Record the decision chain

Save request, tools called, validated parameters, result, rules version and approval. Redact or protect sensitive data in accordance with policy. Logs need to allow auditing without becoming a new source of exposure.

Test real failures

Simulate timeout, missing data, duplicate client, message out of order, expired token and invalid response. The experience needs to offer fallback: try again, ask for information, or transfer to a person with context.

The article on systems integration via API covers the base. To decide the level of autonomy, compare agent, automation and copilot. Well-done integration maintains the system of record as the source of truth and uses AI as a layer of interpretation and coordination.

Read also