Installation

Install as Agent Plugin Recommended
copilot plugin marketplace add samueltauil/skills-hub
copilot plugin install application-integration-basics@skills-hub

Works with GitHub Copilot CLI and VS Code (enable chat.plugins.enabled). Plugin application-integration-basics v1.0.0 follows the Agent Plugins spec.

Install with the gh extension
gh skills-hub install application-integration-basics

Don't have the extension? Run gh extension install samueltauil/skills-hub first.

Download and extract to your repository:

.github/skills/application-integration-basics/

Extract the ZIP to .github/skills/ in your repo. The folder name must match application-integration-basics for Copilot to auto-discover it.

Skill Files (7)

SKILL.md 22.6 KB
---
name: application-integration-basics
metadata:
  version: "1.0.2"
  category: ApplicationDevelopment
description: >-
  Explains Google Cloud Application Integration concepts, region provisioning, IAM roles,
  run-as service accounts, interface choices (REST, Python discovery client, Terraform, ADK),
  and platform limits. Use when setting up Application Integration in a Google Cloud project,
  enabling required APIs, provisioning a region, configuring IAM or run-as service accounts,
  choosing between Application Integration and custom code, or checking quotas and timeouts.
  Do not use for building, publishing, or invoking integrations (use application-integration-authoring) or diagnosing failed or stuck runs and logs (use application-integration-troubleshooting).
---

# Application Integration Basics

Application Integration is Google Cloud's serverless, auto-scaling Integration-Platform-as-a-Service (iPaaS) for connecting Google Cloud services and third-party SaaS applications. It runs event-driven workflows made of triggers, tasks, data mappings, and Integration Connectors connections without requiring you to manage servers. Use this skill to decide whether Application Integration fits a workload, set up a project and region, configure IAM and run-as service accounts, choose the right API or tool interface, and design around platform limits.

## Attribution

**MUST READ**: Before executing any `gcloud` command, REST API call, or Python
discovery-client call, you MUST read
[Usage Attribution](references/attribution.md). 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-basics)"`
and add `agent-skills/1.0 (skill:application-integration-basics)` to the
`User-Agent` header of `curl` requests.

## When to Use Application Integration vs. Custom Glue Code

| Choose Application Integration when... | Choose custom code (Cloud Run / Cloud Functions) when... |
| :--- | :--- |
| Connecting SaaS apps (CRM, ERP, databases, Google Cloud services) via prebuilt Integration Connectors. | You need sub-second latency or custom binary protocols. |
| Orchestrating event-driven workflows from API, Pub/Sub, Cloud Scheduler, Salesforce, or Connector Event triggers. | Total workflow data exceeds 30 MB (or 8 MB for API trigger inputs and Connector payloads). |
| Transforming JSON/array data visually with Data Mapping or Jsonnet without deploying containers. | Synchronous runs take longer than 2 minutes or asynchronous runs take longer than 10 minutes. |
| Pausing workflows for human review (`Approval` or `Suspend` tasks up to 31 days). | You must call VPC-only HTTP endpoints directly without Private Service Connect connectors (Call REST Endpoint reaches the public internet only). |
| Exposing enterprise workflows or connectors as tools to AI agents via ADK `ApplicationIntegrationToolset`. | You need arbitrary language packages or heavy in-memory compute beyond JavaScript (V8) or Jsonnet tasks. |

## Safety and Confirmation Rules

- **Read-only checks run freely**: You may run `gcloud services list`, `gcloud projects get-iam-policy`, and HTTP `GET` calls to `https://integrations.googleapis.com/v1/...` or `https://connectors.googleapis.com/v1/...` without asking first.
- **Require explicit user confirmation before any state change**: Always show the exact command or request payload and wait for user approval before:
  - Enabling APIs (`gcloud services enable`).
  - Provisioning a region (`clients:provision` or `terraform apply` on `google_integrations_client`), especially with Customer-Managed Encryption Keys (CMEK), because **enabling CMEK for a region cannot be undone**.
  - Modifying IAM policies (`gcloud projects add-iam-policy-binding` or `gcloud iam service-accounts add-iam-policy-binding`).
  - Creating, uploading, publishing, unpublishing, executing, testing, or deleting any integration, version, auth profile, or connection.
- **Never bundle destructive scripts** that delete integrations, versions, auth profiles, or connections unattended.
- **Host changes require approval.** Before installing packages (`pip install`) or changing global gcloud or credential state (`gcloud config set ...` such as `auth/impersonate_service_account`, `gcloud auth application-default login` / `set-quota-project`), show the exact command and wait for the user's approval.

## Choosing the Interface

Application Integration has **no `gcloud integrations` command group** (and no `gcloud connectors` command group), and **no Google-managed remote MCP server**. The REST API is the primary control and execution interface.

| Interface | What it covers | Authentication |
| :--- | :--- | :--- |
| **REST API (`curl`)** | Full v1 surface: region provisioning, integrations, versions, download/upload, publish, execute, schedule, executions, suspensions, authConfigs, templates. | `Authorization: Bearer $(gcloud auth print-access-token)` |
| **Python discovery client** | Full v1 surface via `googleapiclient.discovery.build("integrations", "v1")` (and v2 via `build("integrations", "v2")`; no dedicated Cloud Client Library exists). Install with `pip install "google-api-python-client>=2.100.0,<3" "google-auth>=2.20.0,<3"` (changes host or credential state; get the user's approval first). | Application Default Credentials (`gcloud auth application-default login`) (changes host or credential state; get the user's approval first) |
| **Terraform (`hashicorp/google`)** | Infrastructure only: `google_integrations_client` (region setup), `google_integrations_auth_config`, and `google_integration_connectors_*`. Does **not** manage integration workflow versions. | ADC or Terraform provider credentials |
| **ADK (`ApplicationIntegrationToolset`)** | Exposes published API-trigger integrations or Integration Connectors actions/entities as tools for ADK agents (Python v0.1.0+, Java v0.3.0+). | ADC (`gcloud auth application-default login`) (changes host or credential state; get the user's approval first) or service account JSON |
| **Cloud console** | Visual drag-and-drop editor, Quick/Advanced region setup, Approval task resolution, OAuth 2.0 authorization code consent flow. | Browser Google Cloud sign-in |

- Use `gcloud` only for generic Google Cloud tasks: enabling APIs (`gcloud services enable`), printing access tokens (`gcloud auth print-access-token`), managing IAM, and reading Cloud Logging (`gcloud logging read`).
- Integration Connectors includes an outbound **MCP connector** (`MCP v1` and `v2`) that lets a workflow call an external MCP server as a connector target; this is an outbound connector, not a Google-managed MCP server for controlling Application Integration.
- Always use the global endpoint `https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/...` consistently for REST calls.
- **Note on draft testing (`integrations:test`)**: Although `POST .../integrations/INTEGRATION_NAME:test` exists in the v1 REST API, its required `TestIntegrationsRequest.clientId` value is not publicly documented, so do not invent one; test integrations by publishing to a non-production project and calling `:execute`.
- See [references/api-access.md](references/api-access.md) for authentication setup, `curl` commands, Python discovery client patterns, and ADK `ApplicationIntegrationToolset` configuration.

## Step-by-Step Region Setup Workflow

Application Integration is regional: confirm the target region is supported on [Application Integration locations](https://docs.cloud.google.com/application-integration/docs/locations.md.txt) and use `us-central1` as a well-supported default when the user has no preference. The region is the `LOCATION` in every REST path; no `gcloud` default-region setting applies to Application Integration. Provisioning is **per region**. Provisioning `us-central1` does not provision `europe-west1`; repeat region provisioning for every `LOCATION` you use in `PROJECT_ID`. Ensure an active billing account is attached to `PROJECT_ID` before setup—an active billing account is required even when usage stays within the monthly free tier (see the [Application Integration pricing page](https://cloud.google.com/application-integration/pricing)).

### 1. Check and enable required APIs

First check which APIs are already enabled (read-only):

```bash
gcloud services list --enabled --project=PROJECT_ID \
  --filter="config.name:(integrations.googleapis.com OR connectors.googleapis.com OR secretmanager.googleapis.com OR cloudkms.googleapis.com)"
```

After getting user confirmation, enable the required APIs (add `cloudkms.googleapis.com` only if configuring CMEK):

```bash
gcloud services enable \
  integrations.googleapis.com \
  connectors.googleapis.com \
  secretmanager.googleapis.com \
  --project=PROJECT_ID
```

### 2. Verify setup IAM roles on the caller

Setting up Application Integration requires `roles/integrations.integrationAdmin`, `roles/connectors.admin`, and `roles/editor` (plus `roles/cloudkms.admin` for CMEK). Check current bindings (read-only):

```bash
gcloud projects get-iam-policy PROJECT_ID --format=json
```

### 3. Provision the region (`LOCATION`)

Choose one of the three supported paths after getting user confirmation:

- **Option A: REST (`clients:provision`)**
  ```bash
  curl -X POST \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json" \
    -d '{}' \
    "https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/clients:provision"
  ```
  The response is `{}` when provisioning succeeds (`clients:provision` does not apply `runAsServiceAccount`; set the run-as identity on each integration version via `IntegrationVersion.runAsServiceAccount`). `{}` is also returned when the region is already provisioned; the call does not change an existing region's settings. Change HTTP calls or encryption on an existing region from the console's Regions page (when the region is already `ACTIVE`, `cloudKmsConfig`, `enableHttpCall`, and `enableManagedAiFeatures` on `clients:provision` are not applied). If `PROJECT_ID` was already registered through Apigee Integration, provisioning fails.

- **Option B: Cloud console**
  Open `https://console.cloud.google.com/integrations`, select `LOCATION`, and click **Quick setup** (enables the APIs, creates the default service account, and uses Google-managed encryption) or **Advanced setup** (to configure CMEK, HTTP calls, AI features, governance, or variable masking). To add another region later, go to **Regions > Provision new region**.

- **Option C: Terraform (`google_integrations_client`)**
  Use the `google_integrations_client` resource in `hashicorp/google`. Do **not** set `run_as_service_account` on `google_integrations_client`—that argument was removed in provider v8.0.0 (August 26, 2026), and it mapped to the `clients:provision` `runAsServiceAccount` field, which is likewise not applied; set the run-as identity on each integration version (`IntegrationVersion.runAsServiceAccount`) instead.

### 4. Sanity-check region access

Run a read-only list call against the region; a successful `200 OK` response is a good sign that the API is reachable in `LOCATION`:

```bash
curl -sS -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  "https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations"
```

See [references/provisioning-and-terraform.md](references/provisioning-and-terraform.md) for all `ProvisionClientRequest` fields, CMEK and governance options, and complete Terraform examples.

## Core Concepts at a Glance

- **Integrations and Triggers**: An integration is a workflow started by one or more triggers. Synchronous runs (`SYNC`) wait for completion and return output (`integrations.execute`, console test, sync `Call Integration`). Asynchronous runs (`ASYNC`) are fire-and-forget (`integrations.schedule`, Schedule, Cloud Scheduler, Cloud Pub/Sub, Salesforce triggers, and runs resumed after a suspension or approval).
- **Tasks**: Units of work chained after a trigger (such as `Data Mapping`, `Call REST Endpoint`, `Connectors`, `JavaScript` on V8, `Cloud Function`, `Approval`, `Suspend`, `Timer`, loops, and `Call Integration`).
- **Versions and Edit Locks**: Only a `DRAFT` version can be edited (locked to its author for 15 minutes after the last update). Only an `ACTIVE` (published) version runs from triggers. Publishing a version automatically unpublishes the prior active version and cancels any suspended executions of that prior version. Unpublishing moves an active version to `SNAPSHOT` (`PREVIOUSLY_PUBLISHED`). Calling `versions.delete` soft-deletes a version into `ARCHIVED` (listed as `DELETED` on the Integration versions documentation page).
- **Variables**:
  - **Integration variables**: Explicit inputs (`IN`), outputs (`OUT`), `IN_OUT`, or internal variables with `IN_OUT_TYPE_UNSPECIFIED` (`$varName$`).
  - **Task variables**: Auto-generated task outputs named `` `Task_<taskId>_<variableName>` `` where `taskId` is the bare task number in `taskConfigs[].taskId` (for example, `taskId` `"1"` -> `` $`Task_1_responseBody`$ ``).
  - **System variables**: keys are backtick-wrapped (`` `ExecutionId` ``, `` `ExecutionMode` ``, `` `ErrorInfo` `` [`message`, `code`], `` `IntegrationName` ``, `` `Region` ``, `` `ProjectId` ``); reference them as `` $`ExecutionId`$ `` (a bare `$ExecutionId$` names a nonexistent integration variable and fails).
  - **Config variables** (Preview): Environment-specific values defined in `integrationConfigParameters` (with defaults in `parameter.defaultValue`; a top-level `value` on a draft is discarded) and supplied per environment in `configParameters` at publish time (named `` `CONFIG_<NAME>` ``; keys in `configParameters` must **exactly match** a key in `integrationConfigParameters`, backticks included, such as `` "`CONFIG_target_url`" ``, because unknown keys are silently ignored—publish returns 200 and the default stays). **Never store secrets in config variables**—they are exported in plain text. Use an authentication profile (`authConfigs`) or the Secret Manager task instead.
- **Suspensions**: `Suspend` tasks pause up to 31 days and are resumed via the Suspensions API (`suspensions:lift`, with an optional `suspensionResult`, requiring `integrations.suspensions.lift`). `Approval` tasks email approvers and can be approved or rejected in the Cloud console UI or via `suspensions:resolve` (`state`: `"LIFTED"` or `"REJECTED"`, requiring `integrations.suspensions.resolve`). Listing suspensions (`suspensions.list`) requires `integrations.suspensions.list`. All three permissions are included in `roles/integrations.suspensionResolver` (and `roles/integrations.integrationAdmin`), and resuming also requires `roles/iam.serviceAccountUser` on the integration's run-as service account; always confirm with the user before lifting or resolving. `Timer` tasks resume automatically.
- **Authentication Profiles (`authConfigs`)**: Reusable regional credential records (`projects/PROJECT_ID/locations/LOCATION/authConfigs/AUTH_CONFIG_ID`). They are not included when downloading an integration version.

See [references/core-concepts.md](references/core-concepts.md) for full details on version states, trigger types, task categories, variables, suspensions, and authentication profiles.

## IAM and the Run-As Service Account Requirement

### Key IAM roles and service agents

- **Developer & operator roles**: `roles/integrations.integrationAdmin` (full CRUD + delete auth profiles), `roles/integrations.integrationEditor` (create/upload/edit/test/invoke/cancel/replay/publish, including `integrations.integrationVersions.create` and `integrations.integrationVersions.deploy`), `roles/integrations.integrationDeployer` (publish/unpublish via `integrations.integrationVersions.deploy`; holds `list`/`get`/`deploy` but not `create`, so it can publish an existing version but cannot upload), `roles/integrations.integrationInvoker` (invoke/cancel/replay), `roles/integrations.integrationViewer` (view integrations and logs), and `roles/integrations.suspensionResolver` (list, lift, and resolve suspensions: `integrations.suspensions.list`, `integrations.suspensions.lift`, `integrations.suspensions.resolve`; `suspensionResolver` alone cannot read execution records, so also grant `roles/integrations.integrationViewer` to inspect `taskExecutionDetails` or run `:troubleshoot`, or use the approval email link, which carries the execution and task IDs).
- **Service agents**:
  - **Application Integration service agent**: `service-PROJECT_NUMBER@gcp-sa-integrations.iam.gserviceaccount.com` (granted `roles/integrations.serviceAgent`).
  - **Integration Connectors service agent**: `service-PROJECT_NUMBER@gcp-sa-connectors.iam.gserviceaccount.com` (granted `roles/connectors.serviceAgent`).

### Mandatory run-as service account rules (effective October 15, 2026)

1. **Explicit identity required**: For integrations created on or after October 15, 2026 (and for existing integrations at a later date), every run needs an explicit identity—either the triggering caller or a user-managed run-as service account set per integration version via `IntegrationVersion.runAsServiceAccount` (region provisioning via `clients:provision` does not apply `runAsServiceAccount`).
2. **Triggers other than API or Private require a 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, Eventarc, Salesforce, or Connector Event) **cannot be tested or published unless `runAsServiceAccount` is set**. Private triggers are exempt like API triggers, so a sub-integration whose only trigger is Private can be published without `runAsServiceAccount`.
3. **Region governance**: If governance is enabled on the region, a run-as service account is mandatory for **every** new integration and version, including API-trigger integrations.
4. **Service Account User (`roles/iam.serviceAccountUser`)**: Whenever `runAsServiceAccount` is set on a version, the user (or principal) publishing or testing the version must hold `roles/iam.serviceAccountUser` on that service account (or its owning project). At runtime, the invoking caller or trigger service account—and anyone resolving or lifting a suspension—must also hold `roles/iam.serviceAccountUser` on it.
5. **Best practice**: Create one dedicated, minimally scoped user-managed service account per integration. When `runAsServiceAccount` is set and no task-level auth profile is set, it mints tokens for Connector, Call REST Endpoint, and Cloud Function tasks (an OAuth 2.0 or OIDC auth profile on a task takes precedence over `runAsServiceAccount`).

See [references/iam-and-service-accounts.md](references/iam-and-service-accounts.md) for the complete IAM role tables, service agent permissions, credential precedence rules, and `gcloud` IAM commands.

## Key Quotas and Limits to Design Around

| Limit | Value | Design impact |
| :--- | :--- | :--- |
| **SYNC execution timeout** | 2 minutes | Use async triggers or `integrations.schedule` for workflows exceeding 2 minutes; timed-out sync runs become `CANCELLED`. |
| **ASYNC execution timeout** | 10 minutes | Split heavy work into sub-integrations or external jobs if a single async run exceeds 10 minutes. |
| **Max execution lifetime** | 31 days | Includes time paused in `Approval` or `Suspend` tasks (max 44,640 minutes). |
| **Total integration data** | 30 MB | Shared across input/output variables and private-trigger sub-integrations. **Above 10 MB, local logging is disabled**, retries stop working, and monitoring skips the run. |
| **API trigger input size** | 8 MB | Cumulative size across all input variables; larger payloads fail before the workflow starts. |
| **Connectors data & timeout** | 8 MB in/out; 3 min timeout | Application Integration quotas cap cumulative data sent to/from connections at 8 MB and connector response at 20 MB (Integration Connectors quotas cap the Connectors task payload at 10 MB); custom queries cap at 180 seconds and 50,000 rows. |
| **Concurrent executions** | 50 per project per region; 10 per integration (defaults) | Both concurrency caps are adjustable; a burst on a single integration hits the 10-per-integration cap, not 50. The execution request rate quota is shown on the project's Cloud Quotas page and can be adjusted there. |
| **Integrations / tasks / versions** | 1,000 / 100 / 100 | Up to 1,000 integrations per project, 100 tasks per integration, and 100 versions per integration. |
| **Publish propagation** | Up to 10 minutes | Eventual consistency: an older version can keep running for up to 10 minutes after publishing a new version. |

See [references/limits.md](references/limits.md) for all task-specific payload caps, loop iteration limits, Integration Connectors node limits, and pricing details.

## Sibling Skills

- **application-integration-basics** (this skill): Concepts, API enablement, region provisioning, IAM roles and run-as service accounts, interface choices (REST, Python client, Terraform, ADK), and quotas/limits.
- **application-integration-authoring**: Building, uploading, versioning, config variables, publishing, executing, and testing integrations via the REST API; trigger IDs; task gotchas; and CI/CD promotion across projects with download/upload.
- **application-integration-troubleshooting**: Diagnosing failed or stuck executions, checking execution and task states and `ErrorInfo`, listing and filtering executions, Cloud Logging and Cloud Monitoring, suspensions and approvals, Integration Connectors connection health, and IAM / run-as / quota errors.

## Reference Files

- [references/attribution.md](references/attribution.md): Usage attribution for `gcloud` CLI commands, direct `curl` REST calls, and Python discovery-client snippets run in the terminal.
- [references/core-concepts.md](references/core-concepts.md): Triggers, execution modes, task types, version lifecycle, edit locks, variables, suspensions, and authentication profiles.
- [references/iam-and-service-accounts.md](references/iam-and-service-accounts.md): Predefined IAM roles for Application Integration and Integration Connectors, service agents, run-as service account rules, and IAM commands.
- [references/provisioning-and-terraform.md](references/provisioning-and-terraform.md): Per-region provisioning via REST `clients:provision`, Cloud console Quick/Advanced setup, CMEK caveats, and Terraform `google_integrations_*` / `google_integration_connectors_*` resources.
- [references/api-access.md](references/api-access.md): Endpoints, authentication, `curl` examples, Python `google-api-python-client` discovery patterns, ADK `ApplicationIntegrationToolset`, and MCP connector clarification.
- [references/limits.md](references/limits.md): Timeouts, payload caps, concurrency quotas, loop/task limits, Integration Connectors limits, and pricing tiers.
references/
api-access.md 11.5 KB
# API Access, Python Client, and ADK

This reference covers supported Application Integration interfaces, REST endpoints, authentication, `curl` and Python discovery client usage, and ADK `ApplicationIntegrationToolset` configuration.

- [Supported Interfaces and What Does Not Exist](#supported-interfaces-and-what-does-not-exist): Lines 12-18
- [Endpoints, Versions, and OAuth Scope](#endpoints-versions-and-oauth-scope): Lines 19-33
- [Authentication](#authentication): Lines 34-51
- [REST API (`curl`) Examples](#rest-api-curl-examples): Lines 52-87
- [Python Discovery Client (`google-api-python-client`)](#python-discovery-client-google-api-python-client): Lines 88-131
- [ADK `ApplicationIntegrationToolset`](#adk-applicationintegrationtoolset): Lines 132-164

## Supported Interfaces and What Does Not Exist

- **No `gcloud` command group**: Neither `gcloud integrations` nor `gcloud connectors` exists. Use `gcloud` only for generic tasks (`gcloud services enable`, `gcloud auth`, `gcloud projects`, `gcloud iam`, `gcloud logging read`).
- **No dedicated Cloud Client Library**: `https://docs.cloud.google.com/application-integration/docs/libraries` returns 404. For Python, use the discovery-based `google-api-python-client` (`pip install "google-api-python-client>=2.100.0,<3" "google-auth>=2.20.0,<3"`) (changes host or credential state; get the user's approval first).
- **No Google-managed remote MCP server**: Neither Application Integration (`integrations.googleapis.com`) nor Integration Connectors (`connectors.googleapis.com`) appears on Google Cloud's remote MCP servers list.
- **Outbound MCP connector vs. MCP server**: Integration Connectors provides an outbound **MCP connector** (`MCP v1` and `v2`) that lets an integration connect out to an external MCP server and expose its tools as connector entities and actions. It does not expose Application Integration itself as a managed MCP server.

## Endpoints, Versions, and OAuth Scope

| Service | Base endpoint | Discovery document |
| :--- | :--- | :--- |
| Application Integration (v1) | `https://integrations.googleapis.com/v1` | `https://integrations.googleapis.com/$discovery/rest?version=v1` |
| Application Integration (v2) | `https://integrations.googleapis.com/v2` | `https://integrations.googleapis.com/$discovery/rest?version=v2` |
| Integration Connectors (v1) | `https://connectors.googleapis.com/v1` | `https://connectors.googleapis.com/$discovery/rest?version=v1` |
| Integration Connectors (v2 runtime) | `https://connectors.googleapis.com/v2` | `https://connectors.googleapis.com/$discovery/rest?version=v2` |

- **OAuth scope**: All documented methods require `https://www.googleapis.com/auth/cloud-platform`.
- **Global vs. regional host**: Use `https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/...` consistently. Some API trigger pages also show `https://LOCATION-integrations.googleapis.com/v1/...`; if you ever encounter a regional host, the host region and `/locations/LOCATION/` path **must** match (the worked example in the API trigger documentation has a mismatched region bug).
- **v1 vs. v2 surface**:
  - `v1` exposes the full authoring, provisioning, versioning, execution, suspension, auth config, and template surface.
  - `v2` exposes `integrations.execute`, `integrations.schedule`, `executions.list`, `executions.troubleshoot` (LLM root-cause explanation of a failed execution), and `executions.taskExecutions.get`.

## Authentication

- **For `curl` (REST)**: Pass a bearer token from the gcloud CLI:
  ```bash
  -H "Authorization: Bearer $(gcloud auth print-access-token)"
  ```
- **For Python and ADK**: Configure Application Default Credentials (ADC) and set the quota project (changes host or credential state; get the user's approval first):
  ```bash
  gcloud auth application-default login
  gcloud auth application-default set-quota-project PROJECT_ID
  ```
- **Service account impersonation**: When testing as a service account (`SA_EMAIL`), the caller needs `roles/iam.serviceAccountTokenCreator` on `SA_EMAIL` (changes host or credential state; get the user's approval first):
  ```bash
  gcloud config set auth/impersonate_service_account SA_EMAIL
  # Unset when finished:
  gcloud config unset auth/impersonate_service_account
  ```

## REST API (`curl`) Examples

### Read-only: list integrations and versions

```bash
# List integrations in LOCATION
curl -sS -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  "https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations?pageSize=50"

# List versions of INTEGRATION_NAME
curl -sS -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  "https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME/versions"
```

### State-changing: execute a published integration synchronously

Show the exact command and obtain user confirmation before executing an integration. Only an `ACTIVE` (published) integration can be invoked by `:execute`.

```bash
curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  -H "X-Server-Timeout: 120" \
  -d '{
    "triggerId": "api_trigger/TRIGGER_NAME",
    "inputParameters": {
      "customerId": {"stringValue": "123"}
    }
  }' \
  "https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME:execute"
```

- **Field names**: Use `"triggerId"` (the REST reference field name) and `"inputParameters"` (a map of variable name to `ValueType` oneof: `stringValue`, `intValue` as string-encoded int64, `doubleValue`, `booleanValue`, `stringArray`, `intArray`, `doubleArray`, `booleanArray`, or `jsonValue`).
- **Integration name `-`**: Passing `-` instead of `INTEGRATION_NAME` executes **all** integrations in `LOCATION` that have the matching `triggerId`; prefer naming `INTEGRATION_NAME` explicitly so only one integration runs.
- **Error check**: An HTTP 200 response alone does not prove every task succeeded. Inspect `outputParameters` and verify the execution record (`ExecutionDetails.state`, per-task `taskExecutionState`, and `ErrorInfo`) via `executions.list?filter=execution_id="EXECUTION_ID"`.

## Python Discovery Client (`google-api-python-client`)

Install dependencies first with `pip install "google-api-python-client>=2.100.0,<3" "google-auth>=2.20.0,<3"` (changes host or credential state; get the user's approval first), then build the v1 service from the discovery document (`integrations` v1 or `connectors` v1).

```python
import google.auth
from googleapiclient.discovery import build

credentials, _ = google.auth.default(
    scopes=["https://www.googleapis.com/auth/cloud-platform"]
)
service = build("integrations", "v1", credentials=credentials)

# Read-only: list integrations in a region
parent = "projects/PROJECT_ID/locations/LOCATION"
response = (
    service.projects()
    .locations()
    .integrations()
    .list(parent=parent, pageSize=50)
    .execute()
)
for integration in response.get("integrations", []):
    print(integration["name"], integration.get("active", False))

# State-changing (confirm with user first): execute via API trigger
exec_response = (
    service.projects()
    .locations()
    .integrations()
    .execute(
        name="projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME",
        body={
            "triggerId": "api_trigger/TRIGGER_NAME",
            "inputParameters": {
                "customerId": {"stringValue": "123"},
            },
        },
    )
    .execute()
)
print(exec_response.get("executionId"), exec_response.get("outputParameters"))
```

## ADK `ApplicationIntegrationToolset`

ADK (Python v0.1.0+ and Java v0.3.0+) provides `ApplicationIntegrationToolset` to expose Application Integration workflows or Integration Connectors connections as agent tools.

### Integration mode vs. Connection mode

| Mode | Constructor arguments (Python) | How it works and caveats |
| :--- | :--- | :--- |
| **Integration mode** | Required: `project`, `location`, `integration`, `triggers` (list of trigger IDs such as `["api_trigger/TRIGGER_NAME"]`; pass `[]` to expose all API triggers in the integration—omitting `triggers` fails because ADK Python's `IntegrationClient` requires `triggers` not to be `None`). | Generates agent tools from the published integration's OpenAPI spec (`:generateOpenApiSpec`). `tool_name_prefix` and `tool_instructions` are accepted but **silently ignored** in integration mode. |
| **Connection mode** | Required: `project`, `location`, `connection`, plus at least one of `entity_operations` (dict of entity -> list of ops; `[]` means all ops) or `actions`. | Calls an integration named `ExecuteConnection` (from the Connection Tool template, usually auto-created on region provisioning, or overridden via `connection_template_override` in Python SDK v1.21.0+). Application Integration **must** be provisioned in the same region as the connection. |

### ADK Python example (Integration mode)

```python
from google.adk.tools.application_integration_tool.application_integration_toolset import (
    ApplicationIntegrationToolset,
)

integration_tools = ApplicationIntegrationToolset(
    project="PROJECT_ID",
    location="LOCATION",
    integration="INTEGRATION_NAME",
    triggers=["api_trigger/TRIGGER_NAME"],
)
```

### ADK IAM and authentication gotchas

- **IAM roles depend on mode**:
  - **Integration mode**: Grant `roles/integrations.integrationInvoker` + `roles/integrations.integrationViewer`. In integration mode, `ApplicationIntegrationToolset` fetches the tool schema via `POST .../locations/LOCATION:generateOpenApiSpec`, which requires `integrations.integrations.generateOpenApiSpec`. `roles/integrations.integrationInvoker` does **not** contain `integrations.integrations.generateOpenApiSpec` (`roles/integrations.integrationViewer` and `roles/integrations.integrationEditor` do), so granting `roles/integrations.integrationInvoker` alone fails with 403 wherever the agent runs (not only on Agent Runtime). Use `roles/integrations.integrationEditor` only as a broad alternative for integration mode (it also grants version create, update, delete, and publish permissions, and holds no `connectors.*` permissions).
  - **Connection mode**: Grant `roles/integrations.integrationInvoker` (to `:execute` the `ExecuteConnection` integration) + `roles/connectors.viewer` (or a custom role with `connectors.connections.get` and `connectors.connections.getConnectionSchemaMetadata`). When constructed using the agent's own credentials, the toolset calls `GET .../connections/CONNECTION?view=BASIC`, `connectionSchemaMetadata:getEntityType`, and `connectionSchemaMetadata:getAction`, which require `connectors.connections.get` and `connectors.connections.getConnectionSchemaMetadata` (`roles/connectors.viewer` includes both; `roles/connectors.invoker` does **not**, and `roles/integrations.integrationEditor` holds no `connectors.*` permissions). Connection mode does **not** call `:generateOpenApiSpec`, so `roles/integrations.integrationViewer` is needed only in integration mode. `roles/secretmanager.secretAccessor` is not needed for the toolset itself (the ADK client does not read Secret Manager).
- **Dynamic OAuth2 (`auth_scheme` / `auth_credential`)**: Only takes effect in Python connection mode when the connection has `authOverrideEnabled`; otherwise the dynamic credential is ignored with a warning.
- **Java positional constructor**: Java uses positional arguments `(project, location, integration, triggers, connection, entityOperations, actions, serviceAccountJson, toolNamePrefix, toolInstructions)` and does not support `auth_scheme`, `auth_credential`, or `connection_template_override`.
attribution.md 5.0 KB
# Usage Attribution

**MUST READ**: Before executing any `gcloud` command, REST API call, or Python
discovery-client call with this skill, follow these usage attribution
instructions. Tag every command you execute directly in the terminal so usage
can be attributed. The tag identifies only the skill and its version; it carries
no user data.

-   **`gcloud` CLI Commands**: Prefix every `gcloud` invocation, whatever the
    subcommand (in this skill, generic tasks such as enabling APIs, IAM, and
    `gcloud logging read`), with the metrics environment variable. Set it inline
    on each command because shell state may not persist between commands:

    ```bash
    CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:application-integration-basics)" \
    gcloud <command> [flags]
    ```

    Do not use `gcloud config set` for this: it would persist beyond the current
    task and mislabel unrelated usage. `gcloud auth print-access-token` never
    needs the prefix, whether it runs on its own (for example to check
    credentials), inline as `$(gcloud auth print-access-token)`, or assigned
    first, as in `TOKEN="$(gcloud auth print-access-token)"`: it only fetches a
    credential, and the `curl` requests that use the token carry the attribution
    `User-Agent` header themselves. Every other `gcloud` command you run needs
    the prefix, including read-only and local ones such as
    `gcloud services list` or `gcloud config list`.

-   **Direct HTTP and REST Requests (`curl`)**: Application Integration has no
    Google-managed MCP server and no `gcloud integrations` command group; calls
    go to `https://integrations.googleapis.com/v1/...` (and
    `https://connectors.googleapis.com/...`). Add the header
    `-H "User-Agent: agent-skills/1.0 (skill:application-integration-basics)"`
    to every `curl` call you run directly. `curl` sends its own default
    `User-Agent` (`curl/<version>`) only when none is given, so an explicit
    `-H "User-Agent: ..."` replaces it; if a `User-Agent` header is already
    specified, append this string to the end of it rather than overwriting
    existing `User-Agent` data — the collection pipeline parses the
    `agent-skills/<version>` and `skill:<name>` tokens, so any rewording breaks
    attribution:

    ```bash
    curl -sS -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "User-Agent: agent-skills/1.0 (skill:application-integration-basics)" \
      "https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations"
    ```

-   **Python discovery client run directly by you**: When you yourself run a
    one-off Python snippet in the terminal that uses
    `googleapiclient.discovery.build("integrations", "v1")` (or
    `build("connectors", "v1")`), wrap the authorized HTTP object with
    `googleapiclient.http.set_user_agent`, which adds the given string to the
    `User-Agent` header of every request made through that object (the client
    library's own `(gzip)` marker stays after it). Use this pattern
    (`google-auth-httplib2` is installed as a dependency of
    `google-api-python-client`):

    ```python
    import google.auth
    import google_auth_httplib2
    from googleapiclient import discovery
    from googleapiclient.http import set_user_agent

    credentials, _ = google.auth.default(
        scopes=["https://www.googleapis.com/auth/cloud-platform"]
    )
    http = set_user_agent(
        google_auth_httplib2.AuthorizedHttp(credentials),
        "agent-skills/1.0 (skill:application-integration-basics)",
    )
    service = discovery.build("integrations", "v1", http=http)
    ```

    Do not pass both `http=` and `credentials=` to `build`; because `http=`
    bypasses the scoping `build` normally applies, request the
    `https://www.googleapis.com/auth/cloud-platform` scope in
    `google.auth.default` as shown.

-   **Constraint for Generated Code**: The tracking prefix, `User-Agent` header,
    and `set_user_agent` wrapper are strictly for commands you execute directly
    in the terminal. Do NOT include them in code provided to the user for their
    own repositories, including generated scripts, CI/CD pipelines, Terraform
    configurations, ADK agents (including `ApplicationIntegrationToolset` code),
    Python modules, or integration version JSON.

-   **No host or credential changes**: The attribution is per command only. It
    is not a host change and does not need the approval required by the skill's
    "Host changes require approval" rule, because it never persists anything.
    Never persist it with `gcloud config set metrics/request_attribution`, by
    exporting the variable in a shell profile, or in `~/.curlrc`; those would be
    host changes (needing the user's approval under that rule) and would
    mislabel unrelated usage.

-   **User Opt-Out**: If the user asks to disable or remove tracking or
    attribution tags, omit the `CLOUDSDK_METRICS_REQUEST_ATTRIBUTION` variable,
    custom `User-Agent` suffix, and `set_user_agent` wrapper from all commands.
core-concepts.md 13.7 KB
# Core Concepts

This reference explains Application Integration regionality, triggers, execution modes, task categories, version states and edit locks, variable types, suspensions, and authentication profiles.

- [Regionality and Architecture](#regionality-and-architecture): Lines 13-18
- [Triggers and Execution Modes](#triggers-and-execution-modes): Lines 19-39
- [Tasks and Failure Policies](#tasks-and-failure-policies): Lines 40-59
- [Integration Versions and Edit Locks](#integration-versions-and-edit-locks): Lines 60-75
- [Variables and Data Types](#variables-and-data-types): Lines 76-92
- [Suspensions, Approvals, and Timers](#suspensions-approvals-and-timers): Lines 93-102
- [Authentication Profiles](#authentication-profiles): Lines 103-110

## Regionality and Architecture

- **Serverless iPaaS**: Application Integration is fully managed and auto-scales across all zones in a Google Cloud region.
- **Regional scope**: Every integration, version, execution log, and authentication profile lives under `projects/PROJECT_ID/locations/LOCATION`.
- **Cross-region connections**: An integration in one region can use an Integration Connectors connection in a different region. The one exception is ADK `ApplicationIntegrationToolset` in connection mode, which requires Application Integration to be provisioned in the same region as the connection.

## Triggers and Execution Modes

A trigger is an external event that starts a sequence of tasks in an integration. An integration can have multiple triggers; each trigger starts from its own start task, and simultaneous triggers run separate execution copies.

| Execution mode | How it starts | Behavior |
| :--- | :--- | :--- |
| **Synchronous (`SYNC`)** | `projects.locations.integrations.execute`, console Test / Publish test, or `Call Integration` task in SYNC mode. | Blocks until fulfilled or failed. Timeout is 2 minutes (`CANCELLED` on timeout). |
| **Asynchronous (`ASYNC`)** | `projects.locations.integrations.schedule`, Schedule trigger, Cloud Scheduler trigger, Cloud Pub/Sub trigger, Salesforce trigger, or any execution resumed from a suspension or approval. | Fire-and-forget. Timeout is 10 minutes. |

### Supported trigger types

- **API trigger**: `triggerType: "API"`, trigger ID format `api_trigger/TRIGGER_NAME` (`TRIGGER_NAME` up to 64 characters). Multiple API triggers are allowed per integration if each ID is unique.
- **Private trigger**: `triggerType: "PRIVATE_TRIGGER"`, trigger ID format `private_trigger/TRIGGER_NAME`. Invokable only from other integrations (not public APIs). Exempt like API triggers from the October 15, 2026 `runAsServiceAccount` requirement, so a sub-integration whose only trigger is Private can be published without `runAsServiceAccount` (unless region governance is enabled). Shares the 30 MB cumulative data limit with its parent integration. A published private-trigger integration cannot be tested without unpublishing first.
- **Cloud Pub/Sub trigger**: `triggerType: "CLOUD_PUBSUB_EXTERNAL"`, topic format `projects/PROJECT_ID/topics/TOPIC_ID`. Publishing creates the Pub/Sub subscription automatically and exposes the `CloudPubSubMessage` JSON output variable. New or modified Pub/Sub triggers require a trigger service account (the identity that invokes the integration at runtime). 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) cannot be tested or published unless `runAsServiceAccount` is set; whenever `runAsServiceAccount` is set, the user (or principal) publishing or testing the version needs `roles/iam.serviceAccountUser` on it (and at runtime, the trigger's service account needs `roles/iam.serviceAccountUser` on it).
- **Schedule trigger**: `triggerType: "CRON"`, uses a 5-field cron schedule. Google recommends the Cloud Scheduler trigger for higher scheduling reliability.
- **Cloud Scheduler trigger**: `triggerType: "CLOUD_SCHEDULER"`. Requires the Cloud Scheduler API, supports cross-region scheduling, and is billed separately. Editing it in Application Integration overwrites the cron job in a new integration version.
- **Salesforce trigger**: `triggerType: "SFDC_CHANNEL"` or `SFDC_CDC_CHANNEL`.
- **Connector Event triggers**: `triggerType: "INTEGRATION_CONNECTOR_TRIGGER"`. Starts from an Integration Connectors event subscription (such as Apache Kafka, Azure AD, HubSpot, IBM MQ, Jira Cloud, Jira Server Data Center, HL7, RabbitMQ, SAP ERP, SAP Gateway, ServiceNow, Solace, TIBCO EMS, Webhook in Preview, or Zendesk).
- **Eventarc trigger**: `triggerType: "EVENTARC_TRIGGER"`.
- **Error Catcher trigger**: Starts an error-catcher flow attached to a trigger or task (`errorCatcherId`). One catcher per error catcher ID; cannot be nested and cannot connect back to the main flow.

## Tasks and Failure Policies

A task is a unit of work that takes inputs, performs an action, and writes task output variables.

| Task category | Examples and key constraints |
| :--- | :--- |
| **Data transformation** | `Data Mapping` (input/output types must match; cast with `TO_STRING`, `TO_INT`, etc.; null inputs error without a fallback value), `Data Transformer Script` (Preview, Jsonnet; identifiers cannot contain hyphens). |
| **Code & HTTP** | `JavaScript` (V8 runtime; Rhino deprecated January 24, 2025; keep `executesScript(event)`), `Call REST Endpoint` (public internet only, fails on HTTP 4xx/5xx), `Cloud Function` (1st gen and v2 `.run.app`; stops working if VPC Service Controls is enabled for Application Integration). |
| **Enterprise & Cloud** | `Connectors` (calls an Integration Connectors connection; 3-minute timeout), Google Cloud service tasks (KMS, Dataflow, Drive, Document AI, Firestore, Natural Language, Secret Manager, Sheets, Translate, Vertex AI, Workflows), `Apps Script`, `Send Email` (up to 30 recipients). |
| **Flow control & sub-workflows** | `For Each Loop` (up to 8,000 iterations), `For Each Parallel` (up to 10,000 iterations, default parallelism 50), `While Loop` (up to 8,000 iterations), `Call Integration` (callee must have an API trigger or a Private trigger [Private triggers are invokable only from other integrations]; SYNC or ASYNC; for `Call Integration`, `For Each Loop`, and `For Each Parallel`, child responses/output parameters are returned to the parent only in SYNC mode—ASYNC calls return no output parameters), `Return`. |
| **Human & time pauses** | `Approval`, `Suspend`, `Timer`. Integrations containing any of these three tasks cannot be tested in draft state and must be published first (for example, by publishing to a non-production project and calling `:execute`). |

### Per-task failure policies (`FailurePolicy.retryStrategy`)

- `NONE` (default when unset): Dependent tasks do not run if this task fails.
- `FATAL`: Immediately fails the entire integration execution.
- `IGNORE`: Marks the failed task as succeeded so downstream tasks still run.
- `EXPONENTIAL_BACKOFF`, `FIXED_INTERVAL`, `LINEAR_BACKOFF`: Retries the task from the failed task onwards (`maxRetries` and `intervalTime` in seconds required; exponential and linear backoff add 1-5 seconds of delay).
- `RESTART_INTEGRATION_WITH_BACKOFF`: Restarts the entire integration from the first task with initial parameters (`maxRetries` and `intervalTime` in seconds required).

## Integration Versions and Edit Locks

Only a `DRAFT` version can be edited, and only an `ACTIVE` version runs from configured triggers or the `:execute` endpoint.

| State | Meaning |
| :--- | :--- |
| `DRAFT` | Editable version. Locked to its author (`lockHolder`) for 15 minutes after the last update, then released. |
| `ACTIVE` | Published version serving live traffic. |
| `SNAPSHOT` | Prior draft saved when another author clicks **Take Over** in the console, or a previously active version after calling `:unpublish` (tagged `PREVIOUSLY_PUBLISHED`). |
| `ARCHIVED` (API) / `DELETED` (docs) | The REST API `IntegrationVersion.state` enum uses `ARCHIVED`, while the Integration versions documentation page lists `DELETED`. Calling `versions.delete` soft-deletes a version into `ARCHIVED` with no undelete mechanism. |

- **Publishing**: Calling `versions:publish` deploys the version as `ACTIVE`, automatically unpublishes any previously active version, releases any edit lock, and **automatically cancels suspended executions of the previous version**.
- **Eventual consistency**: After publishing a new version, the prior version can continue running for up to 10 minutes.
- **Editing an active integration**: In the console, clicking **Enable Editing** creates a new `DRAFT` version while the `ACTIVE` version keeps running. Uploading a version via `versions:upload` also creates a new `DRAFT` version.
- **Deleting**: Deleting every version of an integration deletes the integration itself.

## Variables and Data Types

Reference standard variables as `$varName$`, and task output or system variables with backticks as `` $`Task_1_responseBody`$ `` or `` $`ExecutionId`$ ``. Dynamic trigger inputs override static defaults.

| Variable kind | Purpose and rules |
| :--- | :--- |
| **Integration variables** | Explicitly defined on `integrationParameters[]` with `inputOutputType` (`IN`, `OUT`, `IN_OUT`, or `IN_OUT_TYPE_UNSPECIFIED` when used only internally). |
| **Task variables** | Auto-generated outputs from tasks, named `` `Task_<taskId>_<variableName>` `` where `taskId` is the bare task number in `taskConfigs[].taskId` (for example, `taskId` `"1"` -> `` $`Task_1_responseBody`$ ``). |
| **System variables** | Auto-generated per run; keys are backtick-wrapped: `` `ExecutionId` ``, `` `ExecutionMode` `` (`SYNC` or `ASYNC`), `` `ErrorInfo` `` (`message`, `code`), `` `IntegrationName` ``, `` `Region` ``, `` `ProjectId` ``. Reference them as `` $`ExecutionId`$ `` (a bare `$ExecutionId$` names a nonexistent integration variable and fails). |
| **Config variables** (Preview) | Environment-specific design-time values (`integrationConfigParameters` on the version with defaults in `parameter.defaultValue` [a top-level `value` on a draft is discarded], `configParameters` on `versions:publish`, named `` `CONFIG_<NAME>` ``; keys in `configParameters` must **exactly match** a key in `integrationConfigParameters`, backticks included, such as `` "`CONFIG_target_url`" ``, because unknown keys are silently ignored—publish returns 200 and the default stays). **Not a secret store**: values export in plain text even when variable masking is enabled. Config variables cannot parameterize connector entity operations or actions. |

### Supported data types (`ValueType` / `IntegrationParameter.dataType`)

- Scalar types: `STRING_VALUE` (`stringValue`), `INT_VALUE` (`intValue`, string-encoded int64 in JSON), `DOUBLE_VALUE` (`doubleValue`), `BOOLEAN_VALUE` (`booleanValue`).
- Array types: `STRING_ARRAY` (`stringArray`), `INT_ARRAY` (`intArray`), `DOUBLE_ARRAY` (`doubleArray`), `BOOLEAN_ARRAY` (`booleanArray`).
- Structured type: `JSON_VALUE` (`jsonValue`, JSON-serialized string).

## Suspensions, Approvals, and Timers

All three tasks pause an execution, and any resumed execution runs in **asynchronous (`ASYNC`)** mode even if the initial call was synchronous. Maximum total execution duration (including pause time) is 31 days (44,640 minutes).

| Task | How it resumes | Key details |
| :--- | :--- | :--- |
| **Suspend** | Automatic timeout or REST API (`POST .../executions/EXECUTION_ID/suspensions/SUSPENSION_ID:lift`). | Suspension `state` is `PENDING`, `REJECTED`, or `LIFTED`. `:lift` is the Suspend-task variant and accepts an optional `suspensionResult` (defaults to `Resolved`, or `Expired` on timeout). Caller needs `integrations.suspensions.lift` (included in `roles/integrations.suspensionResolver`) plus `roles/iam.serviceAccountUser` on the integration's run-as SA (`suspensions.list` needs `integrations.suspensions.list`). Always confirm with the user before lifting. |
| **Approval** | Cloud console Approve/Reject buttons or REST API (`POST .../executions/EXECUTION_ID/suspensions/SUSPENSION_ID:resolve` with `{"suspension": {"eventExecutionInfoId": "EXECUTION_ID", "integration": "INTEGRATION_NAME", "taskId": "TASK_ID", "state": "LIFTED"}}` or `"REJECTED"`, the same call the console buttons make). | Emails recipients. Caller needs `integrations.suspensions.resolve` (included in `roles/integrations.suspensionResolver`) plus `roles/iam.serviceAccountUser` on the integration's run-as SA (`suspensions.list` needs `integrations.suspensions.list`; always confirm with the user before resolving). Outputs boolean `` `Task_<taskId>_isApproved` `` (for example, `taskId` `"2"` -> `` $`Task_2_isApproved`$ ``). Defaults to rejected if unresolved at expiration. |
| **Timer** | Automatic timeout only. | Default 120 seconds, max 44,640 minutes. Waits under 60 seconds behave like sync mode; 60 seconds or more run async. |

## Authentication Profiles

An authentication profile (`projects.locations.authConfigs`, resource name `projects/PROJECT_ID/locations/LOCATION/authConfigs/AUTH_CONFIG_ID`) stores reusable credentials for tasks such as `Call REST Endpoint` and `Cloud Function`.

- **Credential types (`credentialType`)**: `AUTH_TOKEN`, `OIDC_TOKEN` (Google OIDC ID Token), `JWT`, `OAUTH2_AUTHORIZATION_CODE`, `OAUTH2_CLIENT_CREDENTIALS`, `OAUTH2_RESOURCE_OWNER_CREDENTIALS`, `CLIENT_CERTIFICATE_ONLY` (SSL/TLS client cert), `SERVICE_ACCOUNT`, `USERNAME_AND_PASSWORD`, `API_KEY`, `OAUTH2_IMPLICIT`.
- **OAuth 2.0 redirect URI**: `https://console.cloud.google.com/integrations/callback/locations/LOCATION`.
- **Portability**: Authentication profiles are **not** included when you download an integration version (`versions:download`). Create or map them separately in the target project before publishing.
- **Testing gotcha**: If you change the authentication profile on a `Call REST Endpoint` task, publish the integration version before testing (for example, in a non-production project via `:execute`) so the updated profile takes effect.
iam-and-service-accounts.md 14.8 KB
# IAM and Service Accounts

This reference covers predefined IAM roles for Application Integration and Integration Connectors, service agents, the October 15, 2026 run-as service account rules, and `gcloud` IAM commands.

- [Safety Rule](#safety-rule): Lines 14-17
- [Roles for Initial Product Setup](#roles-for-initial-product-setup): Lines 18-25
- [Application Integration Predefined Roles](#application-integration-predefined-roles): Lines 26-42
- [Integration Connectors Predefined Roles](#integration-connectors-predefined-roles): Lines 43-55
- [Task-to-Role Quick Map](#task-to-role-quick-map): Lines 56-71
- [Service Agents](#service-agents): Lines 72-82
- [Run-As Service Account and October 15, 2026 Rules](#run-as-service-account-and-october-15-2026-rules): Lines 83-102
- [gcloud IAM Commands](#gcloud-iam-commands): Lines 103-140

## Safety Rule

Read-only IAM policy inspections (`gcloud projects get-iam-policy`, `gcloud iam service-accounts get-iam-policy`) run freely. Always show the exact command and obtain explicit user confirmation before adding or removing any IAM policy binding.

## Roles for Initial Product Setup

To set up Application Integration and provision a region in `PROJECT_ID`, the administrator needs:
- `roles/integrations.integrationAdmin`
- `roles/connectors.admin`
- `roles/editor`
- `roles/cloudkms.admin` (required only when configuring Customer-Managed Encryption Keys)

## Application Integration Predefined Roles

| Role | Title | What it grants |
| :--- | :--- | :--- |
| `roles/integrations.integrationAdmin` | Application Integration Admin | Full CRUD access to all integrations, versions, executions, suspensions, and authentication profiles (required to delete auth profiles). |
| `roles/integrations.integrationEditor` | Application Integration Editor | List, create, and update integrations; create and edit auth profiles; invoke, cancel, replay, and publish/unpublish integrations (`integrations.integrationVersions.deploy`). Holds no `connectors.*` permissions. |
| `roles/integrations.integrationDeployer` | Application Integration Deployer | Deploy (publish) and undeploy (unpublish) integration versions to the runtime (`integrations.integrationVersions.list`, `get`, `deploy`; does not include `integrations.integrationVersions.create`, so `integrationDeployer` alone can publish an existing version but cannot upload via `versions:upload`). |
| `roles/integrations.integrationInvoker` | Application Integration Invoker | Invoke published integrations (`integrations.integrations.invoke`), run test cases (`integrations.testCases.invoke`), cancel executions (`integrations.executions.cancel`), and replay executions (`integrations.executions.replay`). |
| `roles/integrations.integrationViewer` | Application Integration Viewer | Read-only access to list and view integrations, versions, and execution logs, and generate OpenAPI specs (`integrations.integrations.generateOpenApiSpec`). |
| `roles/integrations.suspensionResolver` | Application Integration Approver | List, lift, and resolve suspended executions and Approval tasks (`integrations.suspensions.list`, `integrations.suspensions.lift`, `integrations.suspensions.resolve`; does not grant `integrations.executions.list`, `integrations.executions.get`, `integrations.executions.cancel`, or `integrations.executions.replay`, so `suspensionResolver` alone cannot read execution records or run `:troubleshoot`). |
| `roles/integrations.serviceAgent` | Application Integration Service Agent | Service agent role granting access to execute integrations (also listed for testing or publishing on the project). |
| `roles/integrations.certificateViewer` | Certificate Viewer | View certificates used by integrations. |
| `roles/integrations.sfdcInstanceAdmin` | Application Integration SFDC Instance Admin | Full CRUD access to all SFDC instances (`sfdcInstanceEditor` and `sfdcInstanceViewer` also exist). |
| `roles/integrations.admin` | Integrations Admin | Broad `integrations.*` access (`roles/integrations.viewer` is the read-only counterpart). |

Apigee Integration roles also exist in IAM (`roles/integrations.apigeeIntegrationAdminRole`, `apigeeIntegrationDeployerRole`, `apigeeIntegrationEditorRole`, `apigeeIntegrationInvokerRole`, `apigeeIntegrationsViewer`, `apigeeSuspensionResolver`, and Beta `roles/integrations.securityIntegrationAdmin`).

## Integration Connectors Predefined Roles

| Role | Title | What it grants |
| :--- | :--- | :--- |
| `roles/connectors.admin` | Connector Admin | Full access to all Integration Connectors resources. |
| `roles/connectors.editor` | Connectors Editor | Create and update Integration Connectors resources. |
| `roles/connectors.viewer` | Connectors Viewer | Read-only access to Integration Connectors resources (includes `connectors.connections.get` and `connectors.connections.getConnectionSchemaMetadata`). |
| `roles/connectors.invoker` | Connector Invoker | Invoke all entity and action operations on connections (does **not** include `connectors.connections.get` or `connectors.connections.getConnectionSchemaMetadata`). |
| `roles/connectors.listener` | Connector Event Listener | Listen to Connector Event subscriptions. |
| `roles/connectors.serviceAgent` | Connectors Platform Service Agent | Service agent role for the Integration Connectors service agent. |

Additional scoped roles exist for sub-resources: `roles/connectors.customConnectorAdmin` / `customConnectorViewer`, `roles/connectors.endpointAttachmentAdmin` / `endpointAttachmentViewer`, `roles/connectors.eventSubscriptionAdmin` / `eventSubscriptionViewer`, and `roles/connectors.managedZoneAdmin` / `managedZoneViewer`.

## Task-to-Role Quick Map

| Action | Minimum predefined role |
| :--- | :--- |
| View integrations | `roles/integrations.integrationViewer` |
| View execution logs | `roles/integrations.integrationViewer` or `roles/integrations.integrationInvoker` |
| Run / invoke (`:execute` / `:schedule`) | `roles/integrations.integrationInvoker`, `roles/integrations.integrationEditor`, or `roles/integrations.integrationAdmin` (`integrations.integrations.invoke`) |
| Replay execution (`:replay`) | `roles/integrations.integrationInvoker`, `roles/integrations.integrationEditor`, or `roles/integrations.integrationAdmin` (`integrations.executions.replay`; **not** in `roles/integrations.suspensionResolver` or `roles/integrations.integrationViewer`) |
| Cancel execution (`:cancel`) | `roles/integrations.integrationInvoker`, `roles/integrations.integrationEditor`, or `roles/integrations.integrationAdmin` (`integrations.executions.cancel`; **not** in `roles/integrations.suspensionResolver` or `roles/integrations.integrationViewer`, so approvers with only `roles/integrations.suspensionResolver` cannot cancel a stuck `SUSPENDED` run) |
| Create, upload (`versions:upload`), edit, or test draft versions, or create/edit auth profiles | `roles/integrations.integrationEditor` (covers `versions:upload` and `versions:publish`; plus `roles/iam.serviceAccountUser` on `runAsServiceAccount` for the user testing or publishing the version whenever `runAsServiceAccount` is set) |
| Delete auth profiles | `roles/integrations.integrationAdmin` |
| Publish or unpublish versions | `roles/integrations.integrationDeployer` or `roles/integrations.integrationEditor` (`integrations.integrationVersions.deploy`, plus `roles/iam.serviceAccountUser` on `runAsServiceAccount` for the user publishing the version whenever `runAsServiceAccount` is set; `roles/integrations.integrationDeployer` alone can publish but cannot upload via `versions:upload`, which requires `integrations.integrationVersions.create`) |
| List, approve (`:resolve`), or lift (`:lift`) a suspended execution | `roles/integrations.suspensionResolver` or `roles/integrations.integrationAdmin` (`integrations.suspensions.list` for `suspensions.list`, `integrations.suspensions.resolve` for `:resolve` [Approval], `integrations.suspensions.lift` for `:lift` [Suspend]) **plus** `roles/iam.serviceAccountUser` on the run-as service account. `roles/integrations.suspensionResolver` alone cannot read execution records (no `integrations.executions.list` or `integrations.executions.get`, returning HTTP 403 on `executions.list` and v2 `:troubleshoot`); to inspect `taskExecutionDetails` (or run `:troubleshoot`), also grant `roles/integrations.integrationViewer` (or use the approval email link, which carries the execution and task IDs). |
| Call a sub-integration (`Call Integration` task) | Caller service account needs `roles/integrations.integrationInvoker` |
| Run ADK `ApplicationIntegrationToolset` | **Depends on mode**: **Integration mode** needs `roles/integrations.integrationInvoker` + `roles/integrations.integrationViewer` (`integrationViewer` supplies `integrations.integrations.generateOpenApiSpec` for `POST .../locations/LOCATION:generateOpenApiSpec`, which `integrationInvoker` does **not** have, so `integrationInvoker` alone fails with 403 wherever the agent runs; `roles/integrations.integrationEditor` is only a broad alternative because it also grants version create/update/delete/publish and holds no `connectors.*` permissions). **Connection mode** needs `roles/integrations.integrationInvoker` (to `:execute` the `ExecuteConnection` integration) + `roles/connectors.viewer` (or a custom role with `connectors.connections.get` and `connectors.connections.getConnectionSchemaMetadata`, which the toolset needs when constructed using the agent's credentials to call `GET .../connections/CONNECTION?view=BASIC`, `connectionSchemaMetadata:getEntityType`, and `connectionSchemaMetadata:getAction`; `roles/connectors.invoker` does **not** have those permissions). Connection mode does **not** call `:generateOpenApiSpec` (`integrationViewer` is only needed in integration mode). `roles/secretmanager.secretAccessor` is not needed for the toolset itself (the ADK client does not read Secret Manager). |

## Service Agents

Two Google-managed service agents are used in `PROJECT_ID`:

| Service | Service agent email | Default role |
| :--- | :--- | :--- |
| Application Integration (`integrations.googleapis.com`) | `service-PROJECT_NUMBER@gcp-sa-integrations.iam.gserviceaccount.com` | `roles/integrations.serviceAgent` |
| Integration Connectors (`connectors.googleapis.com`) | `service-PROJECT_NUMBER@gcp-sa-connectors.iam.gserviceaccount.com` | `roles/connectors.serviceAgent` |

- **Cross-project connection service account**: If an Integration Connectors connection uses a user-managed service account from a different Google Cloud project, grant `service-PROJECT_NUMBER@gcp-sa-connectors.iam.gserviceaccount.com` the `roles/iam.serviceAccountTokenCreator` role in that other project.

## Run-As Service Account and October 15, 2026 Rules

A user-managed **run-as service account** is set per integration version via `IntegrationVersion.runAsServiceAccount` (or **Integration settings > Service account** in the Cloud console, followed by **Publish**). Region provisioning (`clients:provision` and Terraform `google_integrations_client`) does **not** apply `runAsServiceAccount`.

### Credential precedence for tasks

When a task calls an external service (`Connectors`, `Call REST Endpoint`, or `Cloud Function`):
1. **Task-level auth profile wins**: If an OAuth 2.0 profile (or OIDC profile on a `Cloud Function` task) and a user-managed `runAsServiceAccount` are both configured, the auth profile is used by default.
2. **Run-as service account**: If `runAsServiceAccount` is set on the version and no auth profile is attached to the task, `runAsServiceAccount` mints the outbound token.
3. **Default service agent**: If neither an auth profile nor `runAsServiceAccount` is set, tasks fall back to `service-PROJECT_NUMBER@gcp-sa-integrations.iam.gserviceaccount.com`.

### Mandatory identity rules (effective October 15, 2026)

- **Every run needs an explicit identity**: For integrations created on or after October 15, 2026 (and for existing integrations at a later date), every run requires either the triggering caller's identity or an attached run-as service account.
- **Triggers other than API or Private require `runAsServiceAccount`**: 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, Eventarc, Salesforce, or Connector Event) **cannot be tested or published unless `runAsServiceAccount` is set**. Private triggers are exempt like API triggers, so a sub-integration whose only trigger is Private can be published without `runAsServiceAccount`.
- **Region governance**: If governance is enabled on the region, a run-as service account is required for **all** new integrations and versions, regardless of trigger type.
- **Service Account User (`roles/iam.serviceAccountUser`)**: Whenever `runAsServiceAccount` is set on a version, the user (or principal) publishing or testing the version needs `roles/iam.serviceAccountUser` on that service account (or on the project that owns the service account). At runtime (to invoke, resume a suspension on, or call the integration), the invoking principal—the caller, or for Pub/Sub, Cloud Scheduler, Eventarc, and Connector Event triggers, the trigger's service account—must hold `roles/iam.serviceAccountUser` on `runAsServiceAccount`.
- **Two independent IAM checks**: A 403 `PERMISSION_DENIED` error can come from either the caller lacking an Application Integration IAM role or missing `roles/iam.serviceAccountUser` / resource permissions on the run-as service account. Both checks apply independently, so fixing one does not bypass the other.
- **Least-privilege recommendation**: Create one dedicated, minimally scoped user-managed service account per integration.

## gcloud IAM Commands

### Read-only: check project number and existing bindings

```bash
# Look up PROJECT_NUMBER to identify service agent emails
gcloud projects describe PROJECT_ID --format="value(projectNumber)"

# Inspect project IAM policy
gcloud projects get-iam-policy PROJECT_ID --format=json

# Inspect IAM policy on a run-as service account
gcloud iam service-accounts get-iam-policy SA_EMAIL --project=PROJECT_ID --format=json
```

### State-changing: create a dedicated run-as service account and grant roles

Show these commands and obtain user confirmation before running them:

```bash
# 1. Create a dedicated run-as service account for an integration
gcloud iam service-accounts create SA_NAME \
  --display-name="Run-as SA for INTEGRATION_NAME" \
  --project=PROJECT_ID

# 2. Grant the publisher / developer Service Account User on that service account
gcloud iam service-accounts add-iam-policy-binding \
  SA_NAME@PROJECT_ID.iam.gserviceaccount.com \
  --member="user:USER_EMAIL" \
  --role="roles/iam.serviceAccountUser" \
  --project=PROJECT_ID

# 3. Grant the run-as service account only the downstream roles the workflow needs
#    (for example, Connector Invoker if it calls Integration Connectors)
gcloud projects add-iam-policy-binding PROJECT_ID \
  --member="serviceAccount:SA_NAME@PROJECT_ID.iam.gserviceaccount.com" \
  --role="roles/connectors.invoker"
```
limits.md 6.3 KB
# Quotas, Limits, and Pricing

This reference summarizes Application Integration execution timeouts, payload and variable size caps, concurrency quotas, task and loop limits, Integration Connectors limits, and billing and pricing rules.

- [Execution Timeouts and Lifetimes](#execution-timeouts-and-lifetimes): Lines 12-22
- [Payload and Variable Size Limits](#payload-and-variable-size-limits): Lines 23-39
- [Concurrency and Request Rate Quotas](#concurrency-and-request-rate-quotas): Lines 40-50
- [Resource, Task, and Loop Limits](#resource-task-and-loop-limits): Lines 51-67
- [Integration Connectors Limits](#integration-connectors-limits): Lines 68-75
- [Pricing Summary](#pricing-summary): Lines 76-80

## Execution Timeouts and Lifetimes

| Limit | Value | Notes |
| :--- | :--- | :--- |
| Synchronous (`SYNC`) execution timeout | 2 minutes | Timed-out runs become `CANCELLED`. |
| Asynchronous (`ASYNC`) execution timeout | 10 minutes | Applies to Schedule, Cloud Scheduler, Cloud Pub/Sub, Salesforce triggers, `:schedule`, and executions resumed from a suspension or approval. |
| Default `:execute` HTTP timeout | 120 seconds | Controlled by the `X-Server-Timeout` request header. |
| Maximum execution lifetime | 31 days | Maximum total duration (44,640 minutes) an execution can last, including time paused in `Approval` or `Suspend` tasks. |
| Replay execution deadline | 10 minutes | Default deadline for replayed executions before they become `CANCELLED`. |
| Publish propagation window | Up to 10 minutes | Eventual consistency: an older version can keep serving traffic for up to 10 minutes after a new version is published. |

## Payload and Variable Size Limits

| Limit | Value | Notes |
| :--- | :--- | :--- |
| Cumulative integration data size | 30 MB | Total size across all integration input, output, and runtime variables (shared with private-trigger sub-integrations). |
| Local logging cutoff | 10 MB | Above 10 MB of integration data, the run continues but **local logging is disabled**, retry strategies do not run, and the execution does not appear in Cloud Monitoring dashboards. |
| API trigger cumulative input size | 8 MB | Larger requests fail immediately without starting an execution. |
| Cumulative data sent to and received from connections | 8 MB | Across integration input and output variables (Application Integration quotas). |
| Connectors task payload / response | 10 MB payload / 20 MB response | Maximum `Connectors` task payload (Integration Connectors quotas) and connector response size (Application Integration quotas). |
| Data Mapping variable limits | 20 MB (JSON/string); 100,000 elements (array) | Maximum size per variable in a `Data Mapping` task. |
| Data Transformer Script (Jsonnet) memory | 300 MB | Maximum evaluation memory for a `Data Transformer Script` task. |
| JavaScript task request size | 25 MB | Maximum payload passed into the V8 JavaScript task runtime. |
| Call REST Endpoint payload | 20 MB request / 34 MB response | Maximum HTTP request body and response size. |
| Loop data processed / collected output | 20 MB processed; 50 MB collected | `While Loop`, `For Each Loop`, and `For Each Parallel` process up to 20 MB; `While Loop` and `For Each Loop` collect up to 50 MB across sub-integration calls. |
| Cloud Logging entry size | 256 KiB | Above 256 KiB, request and response parameters are omitted from the Cloud Logging entry. |
| Console Execution Logs response | 300 MB | Above 300 MB, the console shows `Response size too large` (use the `executions.list` REST API instead). Event parameters in log messages truncate at 2,000 characters. |

## Concurrency and Request Rate Quotas

| Quota | Default value | Notes |
| :--- | :--- | :--- |
| Concurrent executions per project per region | 50 | Adjustable quota per project in each region. Backoff retries also default to 50 concurrent executions per project and region (up to 10 retries at 10, 20, 40... minutes). |
| Concurrent executions per integration | 10 | Separate adjustable per-integration concurrency cap. A burst on a single integration hits 10 concurrent executions, not 50. |
| Integration execution request rate | Shown on Cloud Quotas page | The execution request rate quota is shown on the Cloud Quotas page for the project and can be adjusted there. |
| Execution-log read requests per minute | 18,000 | Per project. |
| Call REST Endpoint concurrent calls | 100 | Maximum concurrent outbound calls from `Call REST Endpoint` tasks. |
| For Each Parallel concurrency | 50 | Default parallel sub-integration executions. |

## Resource, Task, and Loop Limits

| Limit | Value |
| :--- | :--- |
| Integrations per project | 1,000 |
| Tasks per integration | 100 |
| Versions per integration | 100 |
| Integration name length | 64 characters |
| API trigger name length | 64 characters |
| For Each Loop / While Loop iterations | 8,000 |
| For Each Parallel iterations | 10,000 |
| Call Integration sub-integrations | 10,000 |
| Send Email recipients | 30 |
| Connectors task timeout | 3 minutes |
| Connectors task pagination | Default page size 25; max 50,000 pages |
| Connectors Execute Custom Query | Max 180 seconds; max 50,000 rows |

## Integration Connectors Limits

| Limit | Value | Notes |
| :--- | :--- | :--- |
| Connections per region | 50 | Per Google Cloud project and region. |
| Nodes per connection | 100 | Exceeding allocated node capacity returns HTTP `429` throttling errors; raise min/max nodes or configure a task retry strategy. |
| Maximum unique regions | 20 | Maximum regions in which connections can be created in a project. |

## Pricing Summary

- **Billing account requirement**: An active billing account must be attached to the Google Cloud project even when usage stays within the monthly free tier.
- **Billable dimensions and free tier**: Application Integration provides a monthly free tier covering integration executions, data processed, and Google service connector nodes. Usage beyond the free tier is billed based on integration executions, data processed, and active Integration Connectors nodes (for Google service and third-party connectors).
- **Current rates and cost estimation**: Review current free-tier thresholds and pay-as-you-go rates on the [Application Integration pricing page](https://cloud.google.com/application-integration/pricing), and use the Google Cloud Pricing Calculator to estimate monthly costs.
provisioning-and-terraform.md 8.3 KB
# Provisioning and Terraform

This reference covers per-region provisioning for Application Integration via REST (`clients:provision`), the Cloud console, and Terraform (`hashicorp/google`).

- [Per-Region Provisioning Model](#per-region-provisioning-model): Lines 11-18
- [Enabling Required APIs](#enabling-required-apis): Lines 19-41
- [Provisioning via REST (`clients:provision`)](#provisioning-via-rest-clientsprovision): Lines 42-95
- [Provisioning via Cloud Console](#provisioning-via-cloud-console): Lines 96-104
- [Provisioning via Terraform (`hashicorp/google`)](#provisioning-via-terraform-hashicorpgoogle): Lines 105-158

## Per-Region Provisioning Model

Application Integration is provisioned **one region at a time** within `PROJECT_ID`. Provisioning `us-central1` does not enable `us-east1` or `europe-west1`; you must provision each `LOCATION` where you plan to create integrations.

- **Supported regions**: Regional locations across the Americas, Europe, Asia-Pacific, and the Middle East (for example, `us-central1`, `us-east1`, `europe-west1`, `asia-southeast1`, `me-central1`).
- **Apigee Integration conflict**: If `PROJECT_ID` was already registered through Apigee Integration, provisioning fails.
- **CMEK is permanent**: Enabling Customer-Managed Encryption Keys (CMEK) for a region **cannot be undone**. Always confirm with the user before enabling CMEK.

## Enabling Required APIs

Check enabled APIs first (read-only):

```bash
gcloud services list --enabled --project=PROJECT_ID \
  --filter="config.name:(integrations.googleapis.com OR connectors.googleapis.com OR secretmanager.googleapis.com OR cloudkms.googleapis.com)"
```

After getting user confirmation, enable the required APIs:

```bash
# Standard setup
gcloud services enable \
  integrations.googleapis.com \
  connectors.googleapis.com \
  secretmanager.googleapis.com \
  --project=PROJECT_ID

# Add Cloud KMS only when configuring CMEK
gcloud services enable cloudkms.googleapis.com --project=PROJECT_ID
```

## Provisioning via REST (`clients:provision`)

- **Method and URL**: `POST https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/clients:provision`
- **Success response**: Empty JSON object `{}`. `{}` is also returned when the region is already provisioned; the call does not change an existing region's settings. Change HTTP calls or encryption on an existing region from the console's Regions page (when the region is already `ACTIVE`, `cloudKmsConfig`, `enableHttpCall`, and `enableManagedAiFeatures` on `clients:provision` are not applied).

### `ProvisionClientRequest` body fields

All fields in the request body are optional:

| Field | Type | Description |
| :--- | :--- | :--- |
| `cloudKmsConfig` | object | CMEK settings: `kmsLocation` (required), `kmsRing` (required), `key` (required), `keyVersion` (optional), `kmsProjectId` (optional). Google-managed encryption (GMEK) applies when omitted. |
| `runAsServiceAccount` | string | Not applied by `clients:provision` (the field is accepted but ignored); set `runAsServiceAccount` on each integration version (`IntegrationVersion.runAsServiceAccount`). |
| `createSampleWorkflows` | boolean | When `true`, seeds sample workflows in the region. |
| `enableHttpCall` | boolean | Enables HTTP calls for the region (HTTP is off by default). |
| `enableManagedAiFeatures` | boolean | Enables managed AI features (such as Gemini error troubleshooting) in the region. |
| `skipCpProvision` | boolean | Undocumented field; do not set. |
| `provisionGmek` | boolean | **Deprecated**. Omit this field; GMEK is used automatically when `cloudKmsConfig` is absent. |

### REST example (standard GMEK setup)

Show the exact command and obtain user confirmation before running it. An empty body `{}` provisions the region with defaults (Google-managed encryption and HTTP calls disabled); add `"enableHttpCall": true` or `"enableManagedAiFeatures": true` only if the user explicitly opts in:

```bash
curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  -d '{}' \
  "https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/clients:provision"
```

### REST example (CMEK setup)

Confirm with the user first that CMEK is irreversible for `LOCATION`:

```bash
curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  -d '{
    "cloudKmsConfig": {
      "kmsLocation": "LOCATION",
      "kmsRing": "KMS_RING_NAME",
      "key": "KMS_KEY_NAME",
      "kmsProjectId": "KMS_PROJECT_ID"
    }
  }' \
  "https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/clients:provision"
```

### Other `clients` methods in the v1 discovery document

The v1 discovery document also lists `changeConfig`, `deprovision`, `provisionClientPostProcessor`, `replace`, `switch`, `switchVariableMasking`, and `toggleHttp` on `projects.locations.clients`, but only `provision` appears in the public REST reference navigation—do not rely on the unreferenced methods.

## Provisioning via Cloud Console

Open `https://console.cloud.google.com/integrations` and select `LOCATION` (or go to **Regions > Provision new region** for an additional region).

| Setup mode | What it configures |
| :--- | :--- |
| **Quick setup** | Enables `integrations.googleapis.com`, `connectors.googleapis.com`, and `secretmanager.googleapis.com`, creates the default service account, and uses Google-managed encryption. |
| **Advanced setup** | Lets you choose CMEK (and optionally a separate CMEK for Integration Connectors), **Enable HTTP** (off by default), **Enable AI features**, **Enable governance** (makes a run-as service account mandatory on every new integration and version), and **Variable masking in logs** (Preview). |

## Provisioning via Terraform (`hashicorp/google`)

Terraform manages regional setup, authentication profiles, and Integration Connectors resources. **Terraform does not have a resource for integration workflows or versions** (there is no `google_integrations_integration` resource; manage integration JSON via the REST API).

| Resource | Purpose |
| :--- | :--- |
| `google_integrations_client` | Provisions Application Integration in a region (`projects/{{project}}/locations/{{location}}/clients`). |
| `google_integrations_auth_config` | Creates an authentication profile (`authConfigs`). Must set `depends_on` on `google_integrations_client`. |
| `google_integration_connectors_connection` | Creates an Integration Connectors connection (`name`, `location`, `connector_version` required). |
| `google_integration_connectors_endpoint_attachment` | Creates a regional Private Service Connect (PSC) endpoint attachment for a service attachment. |
| `google_integration_connectors_managed_zone` | Creates a global Cloud DNS peering zone for Integration Connectors. |

### Critical Terraform gotcha (`hashicorp/google` v8.0.0+)

The `run_as_service_account` argument was **removed** from `google_integrations_client` in `hashicorp/google` v8.0.0 (August 26, 2026). It mapped to the `clients:provision` `runAsServiceAccount` field and is likewise not applied. Do not include `run_as_service_account` in `google_integrations_client` blocks, even though older examples on the Manage regions documentation page still show it; set the run-as identity on each integration version (`IntegrationVersion.runAsServiceAccount`) instead.

### Terraform example: region provisioning and auth profile

```hcl
variable "external_api_token" {
  type      = string
  sensitive = true
}

resource "google_integrations_client" "regional_client" {
  project                    = "PROJECT_ID"
  location                   = "LOCATION"
  create_sample_integrations = false
  deletion_policy            = "PREVENT"

  # Optional: uncomment only if using CMEK (cannot be undone for the region)
  # cloud_kms_config {
  #   kms_location   = "LOCATION"
  #   kms_ring       = "KMS_RING_NAME"
  #   key            = "KMS_KEY_NAME"
  #   kms_project_id = "KMS_PROJECT_ID"
  # }
}

resource "google_integrations_auth_config" "token_profile" {
  project      = "PROJECT_ID"
  location     = "LOCATION"
  display_name = "example-auth-token"
  depends_on   = [google_integrations_client.regional_client]

  decrypted_credential {
    credential_type = "AUTH_TOKEN"
    auth_token {
      type  = "Bearer"
      token = var.external_api_token
    }
  }
}
```

License (Apache-2.0)

View full license text
Licensed under the Apache License, Version 2.0. See https://github.com/google/skills/blob/main/LICENSE