AI Prompting & Integration Best Practices
ShuffleSync lets developers choose between Claude, ChatGPT, Gemini, and other AI models to power integration workflows. The best practices in this guide are model-agnostic — they apply regardless of which LLM you select. Where model-specific nuances exist, they are called out explicitly.
Table of Contents
1. Understand what ShuffleSync handles for you
Before writing any prompt, know which concerns are already managed by the platform — and which fall to you.
| Responsibility | Handled by ShuffleSync | You must specify in your prompt |
|---|---|---|
| Authentication | OAuth flows, token refresh, credential storage | Which org, environment, or account to use |
| Retry & rate limiting | Exponential backoff, 429 handling | Max acceptable latency or failure tolerance |
| Pagination | Cursor/page-based pagination for supported connectors | Filter scope, date ranges, record limits |
| Logging | Execution logs in the platform UI | Business-level failure notifications |
| Idempotency (upsert) | Available via platform settings | Whether to upsert, skip, or overwrite on conflict |
| Field mapping (auto) | AutoConnect maps by name similarity | Non-obvious mappings and transformations |
Key Insight
2. Functional prompting over technical specification
ShuffleSync's AI layer translates business intent into workflows and code. The more you specify API paths, HTTP verbs, and field-level JSON, the more you fight that translation layer — and the more brittle your integration becomes when APIs version.
The core principle
Describe the outcome. Let the platform resolve the mechanics.
GET /services/data/v57.0/query?q=
SELECT+Id,Email,FirstName+FROM
+Contact+WHERE+LastModifiedDate
>+LAST_N_DAYS:7
POST /3.0/lists/{id}/members
{email_address, status: 'subscribed'}Sync contacts updated in the last 7 days from Salesforce to the 'Newsletter' list in Mailchimp. Subscribe them if they don't already exist.
PATCH /crm/v3/objects/contacts/{id}
with hs_lead_status=CONNECTED
if Outreach sequenceState=='finished'When a prospect finishes an Outreach sequence, mark them as 'Connected' in HubSpot CRM.
3. The five ingredients of a strong prompt
Every effective ShuffleSync integration prompt should include these five elements. Missing any one of them is the most common cause of incorrect or incomplete workflow generation.
3.1 Source and target
Name both systems explicitly. The AI uses this to resolve the correct connector, schema, and authentication context.
Move data between our CRM and email tool.
From Salesforce (Production org) to Mailchimp (Marketing API v3).
3.2 Data object and filter scope
Describe the record type and filter in plain business terms. Avoid SQL syntax or API query language.
- "Contacts updated in the last 7 days"
- "Paid orders over $500 placed this month"
- "Members whose subscription lapsed more than 30 days ago"
3.3 Trigger type
State when the workflow should run. ShuffleSync will wire the appropriate scheduler or webhook.
| Trigger type | How to state it in a prompt |
|---|---|
| Real-time | "Trigger immediately when a deal is marked Closed Won in Salesforce" |
| Scheduled | "Run every night at midnight UTC" |
| Event-driven | "Whenever a new member registers in the AMS" |
| On-demand | "Allow manual execution from the ShuffleSync UI" |
3.4 Conflict and duplicate rule
Tell the AI what to do when a record already exists in the target. Without this, behaviour is undefined.
- "Update the record if it already exists (upsert by email address)"
- "Skip if a matching record is found — do not overwrite"
- "Create a new record regardless of duplicates"
3.5 Error handling expectation
One sentence is enough. Skipping this defaults to silent failure.
- "Notify me by email if the sync fails"
- "Log failed records and continue processing the rest of the batch"
- "Halt the entire run if more than 5% of records fail"
4. Data mapping and transformation
AutoConnect handles obvious field mappings automatically. You need to specify everything else.
4.1 Non-obvious field mappings
When business labels differ from what the AI might guess, be explicit:
Map Salesforce 'Account Type' to Mailchimp tag, not list name.Map sf.FirstName + ' ' + sf.LastName to FNAME merge field.4.2 Conditional transformation logic
Describe conditional rules in plain English:
If sf.Status == 'Inactive', set Mailchimp status to 'unsubscribed'.If the order total exceeds $1,000, tag the contact as 'VIP' in HubSpot.Skip records where Email is null or empty.4.3 Multi-tenant and environment context
When multiple instances are connected, disambiguate:
Use the Production Salesforce org, not the Sandbox.Write to the EU Mailchimp account (account ID: eu-prod-001).When to include sample payloads
5. Code generation best practices
When using ShuffleSync's code generation feature to produce custom scripts or middleware (outside the platform's visual workflow engine), apply these additional practices.
5.1 Specify the auth pattern
Integration code fails most often on authentication. Tell the AI the mechanism and where credentials live:
Auth via OAuth 2.0 client credentials.Tokens in env vars SFDC_CLIENT_ID and SFDC_SECRET.5.2 Reliability requirements
The platform handles retries and rate limiting in visual workflows. In generated code, you must ask for them explicitly:
- Retry: "Retry up to 3 times on 429 or 5xx with exponential backoff starting at 1 second"
- Rate limits: "Mailchimp allows 10 req/sec — add a rate limiter"
- Timeouts: "Set HTTP timeout to 30 seconds"
- Idempotency: "This job may run twice — upsert by email, don't create duplicates"
- Partial failure: "Process all records; write failed IDs to failed_records.json"
5.3 Testability and observability
Ask for these explicitly — they are rarely generated by default:
- Inject the HTTP client rather than hardcoding it, so it can be swapped for a mock in tests
- Structured JSON logging at INFO level for each record outcome
- Log errors with record ID and API response body
5.4 Iteration strategy
Generate integration code in layers, not all at once:
- Start with data-fetch and transform only — review and test before adding the write step
- When code fails, provide the exact error and stack trace rather than describing the problem
- After generation, explicitly ask: "Review this for missing error handling, credential leaks, and edge cases in the data mapping"
6. Model-specific considerations
ShuffleSync supports multiple AI models. The prompting principles above apply universally. The following nuances help you get the best output from each model.
| Model | Strengths for integration | Watch out for |
|---|---|---|
| Claude (Anthropic) | Strong at following complex multi-part instructions and ambiguous business logic. Tends to ask clarifying questions rather than guess. | May generate more verbose explanations alongside code — specify 'code only, no explanation' if needed. |
| ChatGPT (OpenAI) | Reliable for standard REST integration patterns. Wide familiarity with common SaaS API schemas. | More likely to hallucinate field names on less-common APIs — always validate generated schemas against actual API docs. |
| Gemini (Google) | Well-suited for Google Workspace integrations (Sheets, Drive, Calendar). Strong at structured data handling. | Less consistent on complex conditional transformation logic — break multi-condition rules into separate, simpler prompts. |
| Other models | Capabilities vary. Apply all core principles in this guide. | Test with a single record before running batch operations on any new model. |
Model-agnostic rule
7. Security and credential hygiene
Critical — read before generating any integration code
7.1 Always use environment variable references
Ask the AI to follow the environment variable pattern throughout all generated code:
Use os.environ['SFDC_CLIENT_ID'] and os.environ['SFDC_SECRET'] for credentials.Never inline credential values in the code.7.2 Sensitive field handling
Call out fields that contain PII or sensitive data so the AI generates appropriate handling:
- "Email and phone are PII — do not log their values, only log the record ID"
- "Hash the SSN field before writing to the target system"
7.3 Scope your access
Prompt for minimum-privilege patterns:
- "Request only read scope on Salesforce — this integration never writes back"
- "Use a service account with read-only permissions on the source database"
8. Quick-reference checklist
Use this checklist before submitting any prompt to ShuffleSync's AI, regardless of which model is selected.
| Category | Checklist item |
|---|---|
| Scope | Source system named (including environment/org if ambiguous) |
| Scope | Target system named |
| Scope | Business object described (contacts, orders, members...) |
| Scope | Filter / data scope stated in plain English |
| Trigger | Trigger type specified (real-time / scheduled / event / manual) |
| Mapping | Non-obvious field mappings listed |
| Mapping | Transformation or conditional logic described |
| Reliability | Conflict / duplicate rule stated |
| Reliability | Error handling expectation stated |
| Security | No real credentials in the prompt |
| Security | PII fields identified if relevant |
| Code gen only | Language and library versions specified |
| Code gen only | Auth pattern described |
| Code gen only | Retry, timeout, and rate limit requirements stated |
9. Prompt templates
Copy and adapt these templates for common ShuffleSync use cases.
9.1 Standard sync (visual workflow)
Sync [OBJECT TYPE] from [SOURCE SYSTEM] ([ENVIRONMENT]) to [TARGET SYSTEM].
Filter to [SCOPE/FILTER].
Run [TRIGGER].
If a matching record already exists in the target, [upsert / skip / overwrite].
If the sync fails, [error handling action].9.2 Event-driven workflow
When [EVENT] occurs in [SOURCE SYSTEM], [ACTION] in [TARGET SYSTEM].
Map [SOURCE FIELD] to [TARGET FIELD].
If [CONDITION], [TRANSFORMATION].
Log failures and continue.9.3 Custom code generation
Generate [LANGUAGE + VERSION] code to fetch [OBJECT] from [SOURCE API] where [FILTER].
Transform [RULES].
Write to [TARGET API].
Auth via [AUTH PATTERN] using env vars [VAR NAMES].
Retry up to 3 times on 429/5xx.
Log each record outcome as structured JSON.
Do not log PII field values.10. Common mistakes and how to fix them
| Mistake | Symptom | Fix |
|---|---|---|
| Pasting API endpoints into a functional workflow prompt | Workflow is brittle; breaks on API version change | Describe the outcome in business terms; let ShuffleSync resolve endpoints |
| Omitting the conflict/duplicate rule | Duplicate records accumulate in target system silently | Always state: upsert, skip, or overwrite |
| Skipping error handling | Failed records disappear with no notification | Add one sentence on failure behaviour to every prompt |
| Using real credentials in prompts | Credential exposure risk | Always use environment variable references; never paste secrets |
| Generating full end-to-end code in one shot | Errors are hard to isolate and fix | Generate fetch/transform first; add write step separately after testing |
| Assuming the AI knows your environment | Wrong Salesforce org or Mailchimp account used | Name the environment explicitly: Production, Sandbox, EU instance, etc. |
| Over-specifying for visual workflows | Redundant prompt elements; no additional benefit | Trust the platform for auth, retries, pagination; focus on business logic |
This document is maintained by the ShuffleLabs developer experience team. For questions or contributions, contact your internal developer advocate.