Ellipse Gradient for Header
Salesforce logo

Integrate Salesforce with Martini

Martini integrates Salesforce with enterprise systems by consuming Salesforce REST or SOAP APIs, issuing SOQL and SOSL queries, submitting Bulk API 2.0 jobs, and exposing services for downstream applications. It can receive selected Salesforce event and notification traffic, including compatible outbound messages, Platform Events, and Change Data Capture delivery. Workflows transform Salesforce payloads into canonical models, apply validation and business rules, and write results to databases, queues, files, or other APIs. Scheduling, pagination, retries, per-record error handling, and monitoring support reliable Account, Contact, Lead, Opportunity, Case, and custom-object synchronization without requiring a native Salesforce connector.

Salesforce integration options at a glance

Integration pointSupported by Salesforce?Common use casesHow Martini supports it
REST APIYesSalesforce REST API supports querying, creating, updating, and deleting objects, as well as SOQL, SOSL, and Composite REST resources. It is appropriate for request-response integrations and moderate-volume synchronization.Martini can consume Salesforce REST endpoints, manage authenticated requests, follow pagination links, map JSON payloads, and expose a stable internal REST service over Salesforce data. Workflows can also use composite requests to reduce round trips.
SOAP APIYesSalesforce SOAP API supports WSDL-based enterprise integrations and operations where an established SOAP contract or legacy integration requires it. SOAP queries use Salesforce continuation or cursor mechanisms for larger result sets.Martini can consume Salesforce SOAP services using the relevant service configuration and transform SOAP inputs and outputs. This enables existing WSDL-based operations to participate in workflows alongside REST and other endpoints.
WebhooksLimitedSalesforce does not provide one unrestricted webhook stream for every object and event. Outbound Messages provide SOAP-based notifications for selected workflow-triggered events, while other event delivery depends on Platform Events, Change Data Capture, or Pub/Sub API.Martini can expose or consume compatible webhook-style and SOAP notification services through its API capabilities. Event coverage, delivery protocol, and any intermediary required for Pub/Sub API must be validated for the Salesforce deployment.
Events / triggersYes, for selected eventsSalesforce supports Platform Events, Change Data Capture for selected objects and changes, and event-stream access through Pub/Sub API. Salesforce Flow, Apex, and other automation can initiate outbound calls in suitable configurations.Martini can start workflows from supported incoming event or notification traffic, then use the event as a signal to retrieve the current Salesforce object when the event does not contain a complete representation. Duplicate delivery, replay, retention, and coverage limits should be handled explicitly.
Bulk API / batch exportYesSalesforce Bulk API 2.0 supports high-volume loads and extracts for Accounts, Contacts, Leads, and other objects. It is suited to migrations, periodic synchronization, and large data processing rather than interactive requests.Martini can prepare data, create bulk jobs, upload or submit batches, poll job status, retrieve success and failure results, and reconcile rows individually. Successfully processed rows can be separated from failed rows for controlled correction and retry.
Database accessNoThe supplied research describes Salesforce access through APIs, bulk tooling, and event services rather than direct database connectivity. Salesforce objects should therefore be accessed through supported Salesforce services.Martini can persist synchronized Salesforce data or operational state in supported databases, but it should not be described as connecting directly to the Salesforce database. API responses can be mapped before being written to a target database.
File import/exportYes, through APIs and bulk toolingSalesforce supports file-oriented exchange through its APIs and bulk tooling, particularly for CSV-based high-volume processing. Files can support migration, batch loads, and result reconciliation.Martini can generate or consume CSV and other supported file payloads, transform rows, and orchestrate Salesforce bulk jobs. It can retain result files and route rejected rows to an exception or correction workflow.
AuthenticationYesSalesforce supports OAuth 2.0, JWT bearer, client credentials for supported configurations, username-password OAuth, and access and refresh tokens. Connected-app scopes and Salesforce user, object, field, sharing, and record permissions govern effective access.Martini can keep Salesforce credentials, tokens, certificates, and other secrets in secure configuration rather than workflow code. Integration designs can use OAuth-based authentication and apply Martini API authentication and authorization when exposing Salesforce-backed services.

How Salesforce exposes data and business events

Salesforce REST APIs

Salesforce REST API supports object queries and CRUD operations, SOQL, SOSL, and Composite REST resources. It is the primary mechanism for moderate-volume request-response integration and API-led access to Accounts, Contacts, Leads, Opportunities, Cases, Campaigns, and custom objects.

How This works in Martini

How this works in Martini: a workflow authenticates against Salesforce, calls the required REST resource, follows nextRecordsUrl or another continuation mechanism, maps the response, and sends it to a target system or returns an internal API response.

Example Martini workflow

Authenticate request
Call REST API
Follow pagination
Map fields

Salesforce SOAP APIs

Salesforce SOAP services provide WSDL-based operations for enterprise and legacy integrations. SOAP is useful where an existing contract, enterprise service, or Salesforce-specific operation requires a SOAP interface.

How This works in Martini

How this works in Martini: configure the Salesforce SOAP service, invoke the WSDL-defined operation, transform SOAP input and output structures, and route service faults through controlled error handling.

Example Martini workflow

Configure SOAP service
Invoke WSDL operation
Transform response
Handle service faults

Salesforce Bulk API 2.0

Salesforce Bulk API 2.0 supports high-volume data loads and extracts. Jobs run asynchronously, return a job identifier, and provide result information that can contain both successful and failed rows.

How This works in Martini

How this works in Martini: prepare a file or batch payload, submit a Salesforce bulk job, persist the job ID, poll until completion, retrieve success and failure results, and reconcile rows without retrying successful records.

Example Martini workflow

Prepare batch file
Submit bulk job
Poll job status
Reconcile row results

Salesforce Events and notifications

Salesforce provides selected event-driven mechanisms rather than universal webhooks. Outbound Messages deliver SOAP notifications for selected workflow events; Platform Events and Change Data Capture cover configured event channels and supported object changes, with Pub/Sub API providing event-stream access.

How This works in Martini

How this works in Martini: expose or consume the compatible notification service, validate the event, deduplicate or retain replay state, and optionally retrieve the current Salesforce object before transforming and delivering it downstream.

Example Martini workflow

Receive event signal
Validate notification
Retrieve current object
Route workflow

Scheduled Salesforce synchronization

Scheduled polling is a practical option when required object or change coverage is not available through Salesforce event mechanisms. Selective SOQL queries and synchronization timestamps can limit API consumption.

How This works in Martini

How this works in Martini: a scheduler starts the workflow, the Salesforce API returns pages of changed objects, Martini maps and upserts each page, and a checkpoint records progress for the next execution.

Example Martini workflow

Start scheduled workflow
Query changed objects
Upsert target data
Save checkpoint

Common Salesforce integration patterns

Pattern 1

When to use this pattern

Use scheduled synchronization when an ERP or master data platform must receive Salesforce Accounts and Contacts and event coverage is not sufficient. The workflow should use a selective SOQL filter and a synchronization timestamp or external identifier to avoid repeatedly processing the full object set.

Data Flow
Salesforce
Martini
ERP or master data platform
Example Mapping
Salesforce FieldCanonical FieldTarget Field
Account.Idcustomer.sourceIdcustomer.externalId
Account.Namecustomer.namecustomer.legalName
Contact.Emailcontact.emailcustomerContact.email
Contact.AccountIdcontact.accountSourceIdcustomer.externalAccountId
Martini Implementation

A Martini scheduler invokes Salesforce REST queries, follows nextRecordsUrl until complete, and transforms parent-child relationships into the target model. The workflow validates required identifiers, upserts by External ID, stores a checkpoint, and routes transient failures or rejected rows for controlled retry.

Martini features used:
  • scheduler trigger
  • REST API consumption
  • SOQL query
  • data mapper
  • pagination handling
  • error handling

Pattern 2

When to use this pattern

Use an API-led workflow when internal applications need to create or update qualified Salesforce Leads and Opportunities without coupling each consumer directly to Salesforce. Martini provides a controlled contract, validation layer, and response model for downstream callers.

Data Flow
Internal application
Martini
Salesforce
Example Mapping
Salesforce FieldCanonical FieldTarget Field
lead.emailprospect.emailLead.Email
lead.companyprospect.companyLead.Company
opportunity.amountdeal.amountOpportunity.Amount
opportunity.stagedeal.stageOpportunity.StageName
Martini Implementation

Martini exposes a REST service, authenticates the Salesforce call using the configured OAuth approach, validates required fields and business rules, and maps the request to Salesforce REST operations. It returns Salesforce IDs and status information, while applying idempotency keys and handling validation or permission errors without blindly retrying them.

Martini features used:
  • REST API exposure
  • REST API consumption
  • authentication and secrets
  • data mapper
  • business rules
  • structured error handling

Pattern 3

When to use this pattern

Use event-driven routing when Salesforce Cases must reach a help-desk, messaging, or incident-management platform with lower latency than scheduled polling. Select the Salesforce mechanism based on the required object and event coverage; do not assume every Case change is available as a webhook.

Data Flow
Salesforce event mechanism
Martini
Service or notification platform
Example Mapping
Salesforce FieldCanonical FieldTarget Field
Case.Idticket.sourceIdticket.externalId
Case.Statusticket.statusticket.state
Case.Priorityticket.priorityticket.severity
Case.AccountIdticket.customerSourceIdticket.customerId
Martini Implementation

Martini receives a compatible outbound message or event delivery, validates the notification, and uses the event as a signal to retrieve the current Case when necessary. It deduplicates deliveries, maps status and ownership values, sends the target request, and records failures for replay or reconciliation.

Martini features used:
  • webhook or event consumption
  • REST or SOAP API invocation
  • data mapper
  • deduplication
  • retry workflow
  • monitoring logs

Pattern 4

When to use this pattern

Use Bulk API 2.0 for migration or periodic high-volume processing of Accounts, Contacts, Leads, or other supported Salesforce objects. This pattern separates batch throughput from interactive API traffic and supports row-level reconciliation.

Data Flow
Source files or database
Martini
Salesforce Bulk API 2.0
Example Mapping
Salesforce FieldCanonical FieldTarget Field
customer.externalIdaccount.externalIdAccount.External_Id__c
customer.nameaccount.nameAccount.Name
prospect.emaillead.emailLead.Email
prospect.companylead.companyLead.Company
Martini Implementation

Martini reads or generates the batch file, applies field mapping and normalization, submits the Salesforce job, and stores its identifier. After polling for completion, it retrieves successful and failed results, persists an operational summary, and sends only failed rows through a correction and retry path.

Martini features used:
  • file processing
  • Bulk API job orchestration
  • data transformation
  • scheduled workflow
  • per-record error handling
  • operational monitoring

How to build a Salesforce integration in Martini

Objective

Establish Salesforce access using a connected app and a suitable OAuth 2.0 flow, or JWT bearer authentication for an appropriate server-to-server design. Keep tokens, client credentials, and certificates in secure configuration.

Instructions in Martini

  • Create a Salesforce connected app.
  • Choose OAuth or JWT authentication.
  • Configure required scopes.
  • Use a least-privilege integration user.
  • Store secrets outside workflow logic.

Objective

Select the execution model based on data volume and event coverage. Use REST or SOAP requests for synchronous work, schedules for polling, and selected Salesforce notifications or event streams for near-real-time workflows.

Instructions in Martini

  • Choose an API, event, or schedule trigger.
  • Confirm object and event coverage.
  • Define polling or replay state.
  • Separate interactive and batch traffic.

Objective

Convert Salesforce objects and relationship structures into a canonical contract or target-system model. Include only required fields and account for custom fields, picklists, currencies, and nested query responses.

Instructions in Martini

  • Define source and canonical fields.
  • Map relationships and identifiers.
  • Normalize values and timestamps.
  • Transform JSON, SOAP, or CSV payloads.
  • Validate required fields.

Objective

Enforce idempotency, permissions-aware processing, record-type requirements, and target-specific rules before making changes. Use External IDs or stable source keys to prevent duplicates.

Instructions in Martini

  • Check stable business keys.
  • Apply qualification or routing rules.
  • Handle record types and required fields.
  • Distinguish validation from transient errors.
  • Decide how deletions are represented.

Objective

Create, update, or upsert Salesforce objects and downstream records using the appropriate API, database, queue, or file operation. For bulk work, track job state and reconcile each result row.

Instructions in Martini

  • Invoke the target operation.
  • Use composite or bulk processing when appropriate.
  • Capture Salesforce IDs.
  • Persist checkpoints and job IDs.
  • Route rejected records separately.

Objective

Make API usage, pagination, event delivery, job status, and workflow failures observable. Retry transient failures with backoff while avoiding duplicate writes and preserving actionable error details.

Instructions in Martini

  • Log correlation and Salesforce IDs.
  • Handle pagination to completion.
  • Back off on rate or server errors.
  • Capture per-record failures.
  • Monitor and replay controlled exceptions.

Common Salesforce data objects used in integrations

ObjectTypical UseCommon target systemsMartini handling
AccountsSynchronize organizations, companies, customer master data, and account ownership between Salesforce and an ERP or master data platform.ERP, master data platform, data warehouse, customer portalMartini queries Accounts with SOQL, follows pagination, maps fields to a canonical customer model, and performs idempotent upserts using an External ID or stable source identifier.
ContactsExchange individuals associated with Accounts for customer, sales, service, and communication workflows.ERP, marketing platform, customer data platform, data warehouseMartini transforms Account relationships, contact details, ownership, and status fields, applying validation and duplicate-handling rules before writing to target APIs or databases.
LeadsPublish prospective customers to downstream qualification, marketing, or sales systems and create or update them in Salesforce.Marketing automation, CRM extensions, lead-routing platform, data warehouseMartini validates required fields, normalizes contact information, applies qualification rules, and returns or stores Salesforce IDs after REST or bulk processing.
OpportunitiesSynchronize potential revenue-generating deals, stages, amounts, close dates, and sales ownership with finance or forecasting systems.ERP, finance platform, forecasting system, data warehouseMartini maps Salesforce stages and currencies to a canonical commercial model, applies business rules, and uses stable keys to prevent duplicate opportunity creation during retries.
CasesRoute customer service issues and support requests to help-desk, messaging, or incident-management platforms.Help desk, incident management, messaging platform, customer portalMartini transforms Case status, priority, Account, Contact, ownership, and timestamps, using event notifications or scheduled polling and routing partial failures for review.
CampaignsSynchronize marketing initiatives and campaign context with marketing, analytics, and reporting systems.Marketing automation, analytics platform, data warehouseMartini maps campaign attributes and identifiers, enriches payloads where required, and processes incremental changes through polling or supported Salesforce event mechanisms.

Authentication and security considerations

Use Salesforce connected-app authentication

Salesforce supports OAuth 2.0 and JWT bearer authentication for common API integration designs. The selected flow, scopes, certificate configuration, and Salesforce integration-user permissions must match the required operations.

  • Keep client credentials, tokens, certificates, and security-sensitive configuration in Martini secrets or secure configuration.
  • Use a dedicated Salesforce integration user with least-privilege object, field, sharing, and record access.
  • Apply authentication and authorization to Martini APIs that expose Salesforce-backed services.
  • Review connected-app scopes, API access, field-level security, validation rules, and record types before production use.

Operational considerations for Salesforce integrations

Design for Salesforce limits and data behavior

Salesforce applies org-level API limits and additional limits for bulk jobs, events, concurrent requests, and related services. Prefer selective SOQL, pagination, composite requests, or Bulk API 2.0 according to workload, and avoid unnecessary polling.

  • Follow nextRecordsUrl and SOAP continuation mechanisms until queries are complete.
  • Use exponential backoff for 429 responses and transient server errors.
  • Make writes idempotent with External IDs or stable source keys.
  • Reconcile composite and bulk results at row level because partial failures are possible.
  • Account for duplicate events, delivery delays, replay and retention limits, and incomplete event payloads.
  • Test custom objects, API versions, picklists, required fields, record types, flows, triggers, and validation rules in each Salesforce environment.
  • Monitor API consumption, job status, workflow logs, and failed messages.

Why use Martini instead of scripts or point-to-point integrations?

Centralize integration behavior

Scripts and point-to-point integrations often duplicate authentication, pagination, transformation, retry, and Salesforce-specific validation logic. Martini provides a maintained workflow structure for consuming Salesforce APIs and generating usable services for internal consumers.

  • Coordinate REST, SOAP, bulk, event, database, and file operations in one workflow model.
  • Reuse mappings, authentication configuration, validation, and error-handling services.
  • Expose a stable internal API while Salesforce object models or API versions change.
  • Separate transient failures from validation and permission failures.
  • Support scheduled, real-time, batch, and API-led execution patterns with monitoring and controlled replay.

Frequently asked questions

Does Martini have a native Salesforce connector?

A native Salesforce connector is not documented in the supplied Martini context. Martini can consume Salesforce REST and SOAP APIs, orchestrate Bulk API 2.0 jobs, and integrate selected Salesforce event and notification mechanisms through supported protocols.

Which Salesforce API should an integration use?

Use REST for standard CRUD operations, SOQL, SOSL, and moderate-volume request-response workflows. Use SOAP for WSDL-based or legacy integrations, Bulk API 2.0 for high-volume processing, and event services for supported near-real-time scenarios.

How does Martini authenticate with Salesforce?

Salesforce supports OAuth 2.0 and JWT bearer authentication, along with other flows for supported configurations. Martini should keep credentials, tokens, and certificates in secure configuration and use a dedicated Salesforce integration user with only the necessary permissions.

Can Martini receive all Salesforce record changes as webhooks?

No. Salesforce event coverage depends on the mechanism and object. Outbound Messages, Platform Events, Change Data Capture, and Pub/Sub API provide selected notification and event capabilities, not one universal webhook stream for every Salesforce object and change.

How should Salesforce pagination be handled?

Martini workflows should follow Salesforce continuation information such as nextRecordsUrl or the relevant SOAP cursor until all results have been processed. Synchronization checkpoints can preserve progress across executions.

How can duplicate Salesforce records be prevented?

Use Salesforce External IDs or another stable source-system identifier and implement upsert-style behavior. Retry logic should distinguish safe updates from create operations that could produce a second Account, Contact, Lead, or Opportunity.

Can Martini expose Salesforce data as an internal API?

Yes. Martini can expose a REST service that queries Salesforce, maps Salesforce objects into an internal contract, and applies authentication and authorization for consuming applications.

How should Salesforce custom objects be integrated?

Treat custom objects and fields as environment-specific configuration. Confirm API names, relationships, required fields, permissions, validation rules, record types, and API-version compatibility before deploying the workflow.