连接器使用内置的身份和访问权限管理身份验证与其他Google Cloud 产品进行交互。请注意,使用连接器的工作流仍需要为其服务账号分配适当的权限,以便向给定 API 正确进行身份验证。例如,如需向 Pub/Sub 发布消息,您需要授予与工作流关联的服务账号 roles/pubsub.publisher 角色。如需详细了解如何向其他 Google Cloud 产品进行身份验证,请参阅授予工作流访问 Google Cloud 资源的权限。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[],[],null,["# Understand connectors\n\nWorkflows publishes connectors to make it easier to access other\nGoogle Cloud products within a workflow. For a detailed reference of available\nconnectors, see the\n[Connectors reference](/workflows/docs/reference/googleapis).\n\nConnectors can be used to connect to other Google Cloud APIs within\na workflow, and to integrate your workflows with those Google Cloud\nproducts. For example, you can use connectors to publish Pub/Sub\nmessages, read or write data to a Firestore database, or retrieve\nauthentication keys from Secret Manager.\n[Learn how to use a connector](/workflows/docs/invoke-connector-to-gcp-service).\n\nConnectors simplify calling services because they handle the formatting of\nrequests for you, providing methods and arguments so that you don't need to know\nthe details of a Google Cloud API.\n\nConnectors have built-in behavior for handling [retries](#retries) and\n[long-running operations](#lro).\n| **Note:** API operations that are facilitated by Workflows connectors should not be confused with calling or invoking a Google Cloud service---such as Cloud Run functions or Cloud Run---which is done through an [HTTP request](/workflows/docs/http-requests).\n\nAuthentication\n--------------\n\nConnectors use built-in Identity and Access Management authentication to interact with other\nGoogle Cloud products. Note that a workflow using a connector still\nneeds to have proper permissions assigned to its service account to properly\nauthenticate to a given API. For example, to publish a message to\nPub/Sub, the service account associated with your workflow needs to be\ngranted the [`roles/pubsub.publisher` role](/pubsub/docs/access-control#roles).\nTo learn more about authenticating to other Google Cloud products, see\n[Grant a workflow permission to access Google Cloud resources](/workflows/docs/authentication).\n\nRetries\n-------\n\nAll connectors apply the following\n[retry policy](/workflows/docs/reference/syntax/retrying) and error\nhandling configurations:\n\n- Workflows uses an\n [idempotent retry policy](/workflows/docs/reference/syntax/retrying#retry-idempotent)\n for GET requests.\n\n- Workflows uses a\n [non-idempotent retry policy](/workflows/docs/reference/syntax/retrying#retry-non-idempotent)\n for all other HTTP methods.\n\n- By default, requests time out after 30 minutes. Note that for long-running\n operations, this applies to individual requests (for example, starting the\n operation or checking its status) within the long-running operation. The\n timeout for the entire operation can be configured using the\n `connector_params` field. See the [Connectors reference](/workflows/docs/reference/googleapis).\n\nLong-running operations\n-----------------------\n\nFor calls performing a long-running operation, the following behaviors apply:\n\n- Workflows blocks the workflow execution until the operation\n completes successfully or fails.\n\n- By default, calls time out after 30 minutes. The timeout of the call can be\n changed using the `connector_params` field (to a maximum of one year). See the\n [Connectors reference](/workflows/docs/reference/googleapis).\n\n- Connectors poll long-running operations periodically. By default,\n Workflows uses an exponential backoff of 1.25 when polling,\n starting with 1 second and slowing to 60 seconds between polls.\n Each polling attempt counts as a billable step. The polling parameters can be\n changed using the `connector_params` field. See the [Connectors reference](/workflows/docs/reference/googleapis).\n\n- The preceding retry mechanism applies to a failed polling attempt.\n\n- Poll responses are checked and if the response payload is invalid, a\n `ResponseTypeError` error is returned.\n\n- When an error occurs during a long-running operation, Workflows\n raises an `OperationError` error. The error includes an additional attribute,\n `error`, which contains operation-specific details.\n\nIf a long-running operation fails, the connector call throws an exception with\nthe following attributes:\n\n- `message`: Human-readable error message.\n- `tags`: A list of tags. For a long-running operation connector call, the list includes `OperationError`.\n- `operation`: The failed long-running operation object.\n\nFor a detailed list of supported long-running operation types, see the\n[Connectors reference](/workflows/docs/reference/googleapis).\n\nWhat's next\n-----------\n\n- [Tutorial: Run a batch translation using the Cloud Translation connector](/workflows/docs/tutorials/translation-connector)"]]