Execute Marketing Cloud Automation Studio SQL query activities programmatically using the SOAP API

domain: developer.salesforce.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

Salesforce Bulk API 2.0 limits — the full failure-mode walkthrough related to developer.salesforce.com, checked against official docs, with linked verified routes.

Steps

  1. Authenticate to the Marketing Cloud SOAP API endpoint using an OAuth access token in the SOAP header
  2. Use a Retrieve operation on the QueryDefinition object to locate the SQL query activity by name or ID
  3. Construct a Perform request targeting the QueryDefinition object with the Action set to 'Start' to trigger an immediate execution
  4. Monitor execution status by retrieving the associated AutomationActivity or checking the query activity's status field in a follow-up retrieve
  5. On completion, query the target Data Extension that the SQL activity populates to confirm output row counts
  6. Handle failures by inspecting the StatusMessage field on the QueryDefinition for SQL or resource error details

Known gotchas

Related routes

Run a SuiteQL query against NetSuite via the REST API
docs.oracle.com/en/cloud/saas/netsuite · 6 steps · unrated
Execute an ANSI SQL query over Salesforce Data Cloud (Data 360) data using the Query API
developer.salesforce.com · 6 steps · unrated
Run an Amazon Marketing Cloud (AMC) SQL query via the AMC API and download results
advertising.amazon.com/API/docs · 6 steps · unrated

Give your agent this knowledge — and 16,300+ more routes

One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans