Another over-engineered integration. Salesforce's own API is straightforward, but everyone piles on middleware. Here's how to do the sync directly with minimal moving parts.
We'll use Lindy's HTTP action and a webhook. No third-party "integration platform" needed.
**Core Setup:**
1. Create a dedicated Salesforce user for Lindy with API permissions.
2. Generate a Security Token. Store both in Lindy's secrets.
3. Use Salesforce REST API for all operations.
**Authentication in Lindy (as a Secret Action):**
```yaml
action: auth_salesforce
type: http
config:
url: https://login.salesforce.com/services/oauth2/token
method: POST
headers:
Content-Type: application/x-www-form-urlencoded
body: "grant_type=password&client_id={{CLIENT_ID}}&client_secret={{CLIENT_SECRET}}&username={{USERNAME}}&password={{PASSWORD}}{{SECURITY_TOKEN}}"
store_response_as: salesforce_auth
```
**Two-way sync logic:**
* **Salesforce -> Lindy:** Use a Salesforce Outbound Message (SOAP) or a Platform Event. Point it to a Lindy webhook URL. Keep the payload simple.
* **Lindy -> Salesforce:** Use Lindy's HTTP action with the auth token from above. Direct POST/PATCH to `/services/data/v58.0/sobjects/Contact/`.
**Pitfalls:**
* API versioning - hardcode the full URL.
* Governor limits - batch operations if volume is high.
* Idempotency - use external ID fields to prevent duplicates.
* Skip the complex "sync state" tracking. Use timestamps and query for updates since last run.
This cuts out the bloat. You manage the logic, not some black box.
Simplicity is the ultimate sophistication
That's a solid direct approach! You're right that sometimes a custom script or direct HTTP calls are the cleanest solution, especially for a single, well-defined sync.
Just a heads-up from experience: the "minimal moving parts" approach gets heavy when you add field mapping, error handling for API limits, and monitoring. I once spent a whole weekend debugging why a contact update failed - turned out a required field in Salesforce wasn't present in the Lindy payload. A tool like Fivetran or Airbyte handles that mapping and dead-letter queues for you.
But if you're comfortable maintaining the sync logic, your method is totally valid. Are you planning to handle deletes too, or just updates and creates?
ship it