Skip to main content
Use salesforce in twins and put this configuration under seed_config.salesforce. Salesforce CRM/support workspace with Accounts, Contacts, Cases, EmailTemplates, EmailMessages, custom objects, custom fields, apps, tabs, layouts, and imported org metadata.

Example seed

This is the complete Scenario request body for creating a Scenario. You can also import it with arga test-runner scenarios import --file scenario.json.

Parameters

The following fields belong directly inside seed_config.salesforce. Required nested fields are marked in their tables. Provider-native objects can contain service-specific fields beyond the representative record shapes below.

Seeding behavior

Roles control record visibility through the hierarchy; profiles and permission sets grant object and field access. Preserve role names exactly and assign both the role and required permission grants to each user. Users in one org share record state while retaining their own permissions. Define referenced custom fields in objects; resolve record relationships with declared aliases.

Resource fields

These tables describe the record shapes used by the example. Keep native field names and casing. Map keys such as property names, IDs, and metadata keys are supplied by your fixture.

roles[]

profiles[]

permission_sets[]

oauth_clients[]

oauth_accounts[]

oauth_accounts[].records[]

apps[]

objects[]

objects[].fields[]

objects[].layouts[]

objects[].layouts[].sections[]

accounts[]

contacts[]

cases[]

email_templates[]

records[]

Typed configuration objects

Named object types in the parameter table use these fields.

AccountTeamMemberSeed

ObjectTerritoryAssociationSeed

OpportunityTeamMemberSeed

PermissionSetGroupSeed

PublicGroupSeed

SalesforceAppDefinition

SalesforceOAuthAccount

SalesforceOAuthClient

SalesforceObjectDefinition

SalesforceChildRelationshipDefinition

SalesforceFieldDefinition

SalesforceLayoutDefinition

SalesforceLayoutSection

SalesforcePermissionSet

SalesforceFieldPermission

SalesforceObjectPermission

SalesforceRecordShare

SalesforceRecordTypeDefinition

SalesforceRole

SalesforceSharingDefault

SalesforceSharingRules

SeedRecord

TerritoryModelSeed

TerritorySeed

TerritoryTypeSeed

UserTerritoryAssociationSeed

API coverage and limitations

Twin name: salesforce Supports
  • Salesforce REST discovery, sObject CRUD, describe metadata, relationship reads, and updated/deleted feeds under /services/data/v{version}.
  • Accounts, Contacts, Cases, Leads, Opportunities, Tasks, Events, templates, messages, custom objects, and the standard fields needed for CRM ingestion.
  • Governance objects: Organization, User, Profile, UserRole, PermissionSet, PermissionSetAssignment, ObjectPermissions, FieldPermissions, Group, GroupMember, AccountShare, OpportunityShare, LeadShare, ContactShare, AccountTeamMember, OpportunityTeamMember, Territory2Model, Territory2, UserTerritory2Association, ObjectTerritory2Association, PermissionSetGroup, PermissionSetGroupComponent, UserRecordAccess, EntityDefinition, and RecordType.
  • Relationship objects: OpportunityContactRole, AccountContactRelation, and EventRelation.
  • SOQL child subqueries and multiple-level parent paths, comparison and IN filters, ordering, LIMIT, and pagination. Use Sforce-Query-Options: batchSize=200 to exercise nextRecordsUrl. Positive values below 200 are raised to 200; the maximum is 2,000. Repeat the header on each page request, or the page size defaults to 2,000. LIMIT caps the complete result rather than setting a page size.
  • Stateful Bulk v1 JSON jobs and batches with X-SFDC-Session, including the insert/update/upsert/delete flow used by simple-salesforce. Bulk v2 CSV ingest applies uploaded rows when you set state to UploadComplete and exposes successful, failed, and unprocessed row results. When upserting by Id, a blank Id inserts a new record.
  • Bulk v2 query CSV results with Accept: text/csv, maxRecords, and locator. Follow Sforce-Locator until its value is null; Sforce-NumberOfRecords reports the page count. Existing JSON result clients remain supported.
  • Composite batch version-relative URLs, references in Composite/graph bodies and URLs, graph rollback, and collection external-ID upsert at PATCH /composite/sobjects/{object}/{externalField}.
  • External-ID upserts return 201 when creating and 200 when updating, with id, success, errors, and created in the response. Later graph requests can reference the returned ID for either outcome.
  • OAuth authorization-code login/consent, PKCE, client credentials, username/password, refresh and signed JWT bearer grants. OAuth clients and accounts share the twin’s record and permission state. Users in one org share records while separate orgs remain isolated.
  • SOSL search, invocable case/email actions, Tooling API discovery, and scenario-defined custom objects, fields, record types, layouts, tabs, and apps.
Use SystemModstamp for incremental setup-object sync. PermissionSetAssignment and FieldPermissions have neither CreatedDate nor LastModifiedDate; UserRole has no CreatedDate. Use Profile.Name rather than Profile.Label.

Default OAuth credentials

Use these local test credentials when you have not supplied oauth_clients or oauth_accounts: Open /services/oauth2/authorize with the client ID, a registered redirect_uri, and response_type=code. Use prompt=login, prompt=consent, or prompt=login consent when needed. Exchange the code at /services/oauth2/token; token parameters can be form encoded or supplied in the query string. Body values take precedence. The /oauth2/* aliases also work. Issued tokens enforce expiry, revocation, scopes, object permissions, field permissions, and record access. The bootstrap token follows the default user’s permissions when you configure security.

Scenario configuration

Put these keys inside seed_config.salesforce when you create a Scenario. Custom and package objects and fields must be declared in objects. Adding fields to a standard object extends its existing schema. For example, this seed creates a named role, an API user, and an owned Account:
With security configured, unspecified permissions are denied. API changes to permission assignments, memberships, shares, and teams affect existing tokens. Record grants do not bypass object or field permissions. Scope governance shortcuts with org_id when you seed several orgs.

Sharing-rule metadata

Use the twin-specific REST alternative to SOAP readMetadata(SharingRules):
It requires setup read access and returns fullName, sharingOwnerRules, and sharingCriteriaRules from sharing_rules. This route is an Arga twin extension, not a Salesforce REST endpoint.

Known limitations

  • The catalog covers the fields described above and scenario-defined extensions, not every standard field in every Salesforce edition. Unknown objects and undeclared fields return Salesforce-shaped errors; custom unique and length constraints are enforced.
  • Business records start empty. The default org, authenticated User, and schema catalog are available for governance queries. Seed CRM records through Scenarios or create them through the API.
  • Permission-set muting, criteria-based sharing-rule execution, restriction rules, full implicit sharing, and advanced territory inheritance are not modeled.
  • SOAP Metadata, Bulk v1 XML, hard-delete, Apex REST, Streaming, and Einstein APIs remain outside this surface. Unsupported SOQL expressions fail explicitly.
  • Salesforce APIs are the twin surface; there is no Lightning CRM UI. The OAuth login and consent pages support authentication tests.
  • API responses include a simulated Sforce-Limit-Info header. The configured API version does not imply complete coverage of that Salesforce release.
  • Twin Run TTL is an Arga plan entitlement: Free runs are limited to 10 minutes; eligible paid plans can request up to 480 minutes. OAuth token lifetimes do not extend the Twin Run.
MCP tools: get_twin_catalog, provision_twins, start_url_validation, get_validation_results. See Scenario seeding for saving, provisioning, and resetting fixtures.