application-integration-authoring
Builds, versions, publishes, tests, and executes Google Cloud Application Integration workflows through the REST API and Python discovery client, and promotes versions across environments. Use when listing integrations, downloading or uploading integration versions as JSON, configuring API triggers or config variables, publishing drafts, invoking integrations, or automating CI/CD promotion. Do not use for initial region provisioning and IAM setup (use application-integration-basics) or diagnosing failed runs and logs (use application-integration-troubleshooting).
Application Integration Authoring
Google Cloud Application Integration workflows are authored, versioned, published, and executed programmatically through the REST API (https://integrations.googleapis.com/v1/...) or the discovery-based Google API Python client (googleapiclient.discovery.build("integrations", "v1")).
There is no gcloud integrations command group, no Google-managed MCP server for Application Integration, and no documented Terraform resource for integrations or versions. Use gcloud only for authentication, enabling APIs, and IAM bindings. Use Terraform only for region provisioning (google_integrations_client), authentication profiles (google_integrations_auth_config), and Integration Connectors (google_integration_connectors_connection).
For initial project setup, region provisioning, and IAM role definitions, use the application-integration-basics skill. For diagnosing failed or stuck runs, execution logs, and quota errors, use the application-integration-troubleshooting skill.
Attribution
MUST READ: Before executing any gcloud command, REST API call, or Python
discovery-client call, you MUST read
Usage Attribution. For commands executed directly
in the terminal (never in generated scripts, Terraform, ADK agents, or user
code), prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:application-integration-authoring)"
and add agent-skills/1.0 (skill:application-integration-authoring) to the
User-Agent header of curl requests.
Safety and Confirmation Rules
- Read-only operations run freely:
integrations.list,integrations:search,versions.list,versions.get,versions:download,authConfigs.list, andexecutions.list. - Confirm before any state change or execution: Before creating, uploading, patching, publishing, unpublishing, testing, executing, scheduling, or deleting an integration or version, or modifying IAM or auth configs, show the exact command and payload to the user and get explicit confirmation.
- Host changes require approval. Before installing packages (
pip install) or changing global gcloud or credential state (gcloud config set ...such asauth/impersonate_service_account,gcloud auth application-default login/set-quota-project), show the exact command and wait for the user's approval. - Never store secrets in config variables: Config variables (
CONFIG_*) are stored and exported in plain text. Always use authentication profiles (projects.locations.authConfigs) or the Secret Manager access task for credentials.
Prerequisites Checklist
- Install Google Cloud SDK: Follow Install the gcloud CLI if
gcloudis not installed. - Billing and project: Ensure the Google Cloud project has an active billing account attached (required even when usage stays within the free tier), then set the target project (changes global gcloud state; get the user's approval first):
gcloud config set project PROJECT_ID - Enable required APIs:
gcloud services enable integrations.googleapis.com connectors.googleapis.com secretmanager.googleapis.com - Provision the region: Application Integration is regional: confirm the target region is supported on Application Integration locations and use
us-central1as a well-supported default when the user has no preference. The region is theLOCATIONin every REST path; nogclouddefault-region setting applies to Application Integration. The targetLOCATIONmust be provisioned via the Cloud console orPOST .../clients:provisionbefore authoring integrations (seeapplication-integration-basics). - Authenticate:
- For
curl: rungcloud auth login(changes host or credential state; get the user's approval first) and pass-H "Authorization: Bearer $(gcloud auth print-access-token)". - For the Python client (install with
pip install "google-api-python-client>=2.100.0,<3" "google-auth>=2.20.0,<3"): rungcloud auth application-default loginandgcloud auth application-default set-quota-project PROJECT_ID(or setGOOGLE_APPLICATION_CREDENTIALSfor a service account) (changes host or credential state; get the user's approval first). - For service account impersonation: run
gcloud config set auth/impersonate_service_account SA_EMAIL(requiresroles/iam.serviceAccountTokenCreator) (changes host or credential state; get the user's approval first).
- For
- Verify IAM roles:
- Create, upload, or edit drafts:
roles/integrations.integrationEditor(coversversions:upload, which needsintegrations.integrationVersions.create, andversions:publish) - Publish or unpublish:
roles/integrations.integrationDeployerorroles/integrations.integrationEditor(roles/integrations.integrationDeployeralone can publish an existing version but cannot upload viaversions:upload), plusroles/integrations.serviceAgentgranted to the Application Integration service agent (service-PROJECT_NUMBER@gcp-sa-integrations.iam.gserviceaccount.com) - Invoke integrations:
roles/integrations.integrationInvoker - Act as the run-as service account: integrations created on or after October 15, 2026 with any trigger other than an API or Private trigger (for example Schedule, Cloud Scheduler, Cloud Pub/Sub, Salesforce, or Connector Event; Private triggers are exempt like API triggers, so a sub-integration whose only trigger is Private can be published without
runAsServiceAccount) cannot be tested or published unlessrunAsServiceAccountis set (and region governance requires it for all integrations); wheneverrunAsServiceAccountis set, the user publishing or testing the version needsroles/iam.serviceAccountUseron it (and at runtime, the invoking caller or trigger service account needsroles/iam.serviceAccountUseron it).
- Create, upload, or edit drafts:
Decision Flow
| Goal | Action | Endpoint / Method |
|---|---|---|
| Inspect existing integrations in a region | List integrations, then list versions | GET .../integrations then GET .../versions |
| Export an integration version to source control | Download version JSON | GET .../versions/VERSION_ID:download?fileFormat=JSON |
Create an integration or add a new DRAFT version from JSON | Upload version JSON (creates the integration if it does not exist, or adds a new DRAFT version; still needs :publish) | POST .../integrations/INTEGRATION_NAME/versions:upload |
| Create a brand-new integration and fail on a name clash | Create first DRAFT version with newIntegration=true (returns ALREADY_EXISTS if INTEGRATION_NAME already exists) | POST .../integrations/INTEGRATION_NAME/versions?newIntegration=true |
Edit an existing DRAFT version | Check lockHolder, then patch or upload | PATCH .../versions/VERSION_ID?updateMask=... |
Edit an ACTIVE (published) integration | Upload or create a new DRAFT version | POST .../integrations/INTEGRATION_NAME/versions:upload |
| Externalize environment-specific URLs or IDs | Define CONFIG_<NAME> and supply at publish | integrationConfigParameters + versions:publish |
| Store API keys, OAuth credentials, or certs | Create an authentication profile | POST .../authConfigs |
| Test an integration before production | Publish to a non-production project and invoke :execute | POST .../versions/VERSION_ID:publish then POST .../integrations/INTEGRATION_NAME:execute |
Deploy a DRAFT to serve live traffic | Publish version with configParameters | POST .../versions/VERSION_ID:publish |
| Invoke a published integration synchronously | Call :execute with api_trigger/TRIGGER_NAME | POST .../integrations/INTEGRATION_NAME:execute |
| Invoke a published integration asynchronously | Call :schedule with scheduleTime | POST .../integrations/INTEGRATION_NAME:schedule |
| Promote a version across projects (CI/CD) | Download JSON -> Upload to target -> Publish | :download -> :upload -> :publish |
See references/rest-api-cheatsheet.md for full request parameters, query filters, and IAM permissions for each method.
Core Authoring Workflow
1. List Integrations and Download a Version
List integrations in LOCATION and list versions for a specific INTEGRATION_NAME:
TOKEN="$(gcloud auth print-access-token)"
# List integrations in the region
curl -sS -H "Authorization: Bearer ${TOKEN}" \
"https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations?pageSize=50"
# List versions (ordered by most recently modified)
curl -sS -H "Authorization: Bearer ${TOKEN}" \
"https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME/versions?orderBy=last_modified_time%20desc"
Download a specific version (VERSION_ID is the UUID at the end of the version's name field) as portable JSON:
curl -sS -H "Authorization: Bearer ${TOKEN}" \
"https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME/versions/VERSION_ID:download?fileFormat=JSON" \
| jq -r '.content' > integration-version.json
2. Understand the IntegrationVersion Structure
An IntegrationVersion JSON object contains four primary arrays and version-level settings:
triggerConfigs: Entry points that start the workflow. Each entry requires a uniquetriggerNumber, plustriggerType(such asAPIorPRIVATE_TRIGGER), optionaltriggerId(auto-generated frompropertiesif omitted; for API triggers:api_trigger/TRIGGER_NAME), andstartTaskspointing to the firsttaskId.taskConfigs: Units of work. Each entry needstask(the task type, such asEmailTaskin the public upload sample, orFieldMappingTaskin a discovery enum description), a uniquetaskId,parameters,nextTasks, and optionalfailurePolicyorerrorCatcherId.integrationParameters: Input, output, and transient variables (key,dataTypesuch asSTRING_VALUEorJSON_VALUE,inputOutputTypeofIN,OUT,IN_OUT, orIN_OUT_TYPE_UNSPECIFIED, anddefaultValue).integrationConfigParameters: Environment-specific config variable definitions (parameterwith key`CONFIG_<NAME>`andparameter.defaultValue; a top-levelvaluein uploaded or created draft JSON is discarded, so per-environment values go inconfigParametersat publish).runAsServiceAccount: Dedicated user-managed service account email. When set and no authentication profile (authConfig) is configured on the task, it is used to generate the auth token for Connector (Connectors), REST (Call REST Endpoint), and Cloud Function tasks; an authentication profile configured on the task takes precedence overrunAsServiceAccount.
Always use triggerConfigs, taskConfigs, and integrationParameters. Never use triggerConfigsInternal, taskConfigsInternal, or integrationParametersInternal because they are deprecated. See references/integration-version-json.md for field schemas, ValueType shapes, and a minimal IntegrationVersion JSON template.
3. Create or Upload a DRAFT Version
Each integration allows up to 100 versions and 100 tasks, and INTEGRATION_NAME can be at most 64 characters. Calling versions:upload creates a new DRAFT version—creating the integration automatically if INTEGRATION_NAME does not exist yet, or adding the next DRAFT version if it already exists (for example, uploading onto version 5 creates version 6). The uploaded version is in DRAFT state and still requires versions:publish to serve traffic. Use POST .../versions?newIntegration=true (passing an IntegrationVersion JSON body) only when you explicitly want the call to fail with ALREADY_EXISTS if INTEGRATION_NAME already exists.
# Upload integration-version.json as a new DRAFT version
PAYLOAD="$(jq -n --rawfile content integration-version.json '{content: $content, fileFormat: "JSON"}')"
curl -sS --fail-with-body -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d "${PAYLOAD}" \
"https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME/versions:upload"
Capture the new VERSION_ID from .integrationVersion.name in the response (projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME/versions/VERSION_ID).
4. Version States and Edit-Lock Rules
| State | Meaning | Editable? | Can Serve Triggers? |
|---|---|---|---|
DRAFT | Version actively being edited; its edit lock is held by its author (lockHolder email) for 15 minutes from the last update | Yes (only by lockHolder) | No |
ACTIVE | Published version serving live traffic | No | Yes |
SNAPSHOT | Prior draft (when another author takes over in the console) or unpublished version (PREVIOUSLY_PUBLISHED) | No | No |
ARCHIVED | Soft-deleted via versions.delete (no undelete; listed as DELETED on the Integration versions documentation page) | No | No |
- Edit-lock enforcement: A
DRAFTversion's edit lock is held by its author (lockHolder). Callingversions:publishorversions.deleteon aDRAFTfails if the caller is not thelockHolder(versions:publishandversions.deleterelease any existing lock when they succeed). - No v1 lock-takeover API:
takeoverEditLockdoes not exist onprojects.locations.integrations.versionsin the v1 REST API (it only exists onversions.testCases). If aDRAFTis locked by another user, wait 15 minutes fromupdateTimefor the lock to expire automatically, or click Take Over in the Cloud console (which converts the existing draft toSNAPSHOTand creates a newDRAFT).
5. Config Variables vs Authentication Profiles
- Config variables (
CONFIG_<NAME>): Use for non-secret environment values (backend hostnames, Pub/Sub topics, connection names). Define them inintegrationConfigParameterson the draft (putting any default inparameter.defaultValue, because a top-levelvalueon a draft is discarded) and pass their per-environment values inconfigParameterswhen callingversions:publish. Gotcha: Keys inconfigParametersat publish must exactly match a key inintegrationConfigParameters, backticks included (for example,"`CONFIG_target_url`"); unknown keys are silently ignored, not rejected (versions:publishreturns 200 and the default stays). Config variables cannot configure Integration Connectors entity operations or actions. - Authentication profiles (
authConfigs): Use for API keys, OAuth 2.0 credentials, JWTs, OIDC tokens, SSL/TLS certificates, and service accounts. Auth profiles are regional resources (projects/PROJECT_ID/locations/LOCATION/authConfigs/AUTH_CONFIG_ID) and are not included when you download an integration version. Create them in each target project viaPOST .../authConfigsor Terraformgoogle_integrations_auth_config.
6. Test, Publish, and Unpublish
- Recommended testing path: Test integrations by publishing the version in a non-production project (
versions:publish) and invokingintegrations:executethere.- Note on
integrations:test: The v1 REST API includesPOST .../integrations/INTEGRATION_NAME:testfor testing aDRAFT, which requiresTestIntegrationsRequest.clientId("Required. This is used to identify the client on whose behalf the event will be executed."), but the public documentation does not specify what value to pass. Do not invent aclientIdvalue; publish to a non-production project and call:executeinstead. (Draft testing also cannot runApproval,Suspend, orTimertasks, and Call REST Endpoint authentication profile changes only take effect after publishing.)
- Note on
- Publish (
versions:publish): Deploys the version asACTIVEand releases any edit lock (fails if the version is alreadyACTIVEorARCHIVED, or if it is aDRAFTwhoselockHolderdiffers from the caller). Any previouslyACTIVEversion is automatically un
Files of this skill
skills/cloud/application-integration-authoring/references/attribution.mdskills/cloud/application-integration-authoring/references/cicd-promotion.mdskills/cloud/application-integration-authoring/references/integration-version-json.mdskills/cloud/application-integration-authoring/references/rest-api-cheatsheet.mdskills/cloud/application-integration-authoring/references/tasks-and-gotchas.mdskills/cloud/application-integration-authoring/references/triggers-and-execution.md