Cloud Function task
The Cloud Function task lets you configure and run Cloud Run functions from your integration. Cloud Run functions represent the next evolution of Cloud Functions, offering an event-driven programming model with enhanced control and scalability, leveraging the Cloud Run serverless platform. Cloud Run functions provide a single serverless solution for all workload types.
The Cloud Function task supports the following versions of Cloud Run functions:
- Cloud Functions (1st gen)
- Cloud Run functions created using the Cloud Functions v2 API
For detailed information about the differences between Cloud Run functions versions, see the Cloud Functions comparison guide.
Before you begin
Ensure that you perform the following tasks in your Google Cloud project before configuring the Cloud Function task.
- To connect to Cloud Function, ensure that you have either created an OAuth 2.0 profile or attached a user-managed service account to your integration:
-
If your integration has a service account attached, assign the Cloud Function Invoker IAM role to that service account.
For information about granting roles to a service account, see Manage access to service accounts.
- The Cloud Function task only supports authentication profiles of type Google OIDC ID Token. Create an authentication profile of type Google OIDC ID Token using the service account with the Cloud Functions Invoker IAM role assigned. If your Cloud Function task does not require authentication, the Authentication profile field in the task configuration pane can be left empty.
- Ensure that VPC Service Controls is not set up for Application Integration in your Google Cloud project.
If your integration has both OIDC ID profile and a user-managed service account configured, then by default the OIDC ID profile is used for authentication. If neither OIDC ID profile nor user-managed service account is configured, then the default service account (service-PROJECT_NUMBER@gcp-sa-integrations.iam.gserviceaccount.com) is used to call the Cloud Function task.
Configure the Cloud Function task
To configure the Cloud Function task in your integration, perform the following steps:
- In the navigation menu, click Integrations.
This opens the list of available integrations in the Application Integration UI.
- Select an existing integration or click Create integration.
If you are creating a new integration, enter a name and description in the create dialog, and click Create.
- From the Tasks drop-down, click Cloud Function to place it in the integration editor.
- Click the Cloud Function element on the designer to open the configuration pane, then click Configure Cloud Function.
-
If you are prompted to grant permissions to the service account, click
Grant.
Application Integration automatically grants the required permissions to the service account.
- In the Cloud Function configuration pane, select one of the following options:
- Link existing function: Select this option to associate an existing function with your integration. You can link Cloud Functions (1st gen) and Cloud Functions created with the Cloud Functions v2 API from your integration.
- In the Cloud Function Trigger URL field, enter the trigger URL of the existing function.
The URL should follow one of the following formats:
- In the Cloud Function Trigger URL field, enter the trigger URL of the existing function.
- Link existing function: Select this option to associate an existing function with your integration. You can link Cloud Functions (1st gen) and Cloud Functions created with the Cloud Functions v2 API from your integration.