### Install ajv-cli for Validation Source: https://github.com/googlecloudplatform/workflows-samples/blob/main/jsonschema/README.md Install the necessary Node.js packages to perform command-line schema validation. ```sh npm install -g ajv-cli ajv-formats ``` -------------------------------- ### Perform HTTP GET Request Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Sends an HTTP GET request with headers and query parameters, capturing the response body. ```yaml # http_get.workflows.yaml - get_message: call: http.get args: url: https://www.example.com/endpoint headers: Content-Type: "text/plain" query: some_val: "Hello World" another_val: 123 result: the_message - return_value: return: ${the_message.body} ``` -------------------------------- ### Fetch Current Time and Search Wikipedia Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt A complete workflow example that chains API calls. It first fetches the current time from an external API and then uses the day of the week to search Wikipedia. The results from both calls are processed. ```yaml # myFirstWorkflow.workflows.yaml - getCurrentTime: call: http.get args: url: https://timeapi.io/api/Time/current/zone?timeZone=Europe/Amsterdam result: currentTime - readWikipedia: call: http.get args: url: https://en.wikipedia.org/w/api.php query: action: opensearch search: ${currentTime.body.dayOfWeek} result: wikiResult - returnResult: return: ${wikiResult.body[1]} ``` -------------------------------- ### Iterate with For Loop Range Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Performs iteration over a numeric range with inclusive start and end values. ```yaml # iterate_for_range.workflows.yaml - assignStep: assign: - sum: 0 - loopStep: for: value: v # required, v = 1, 2, ..., 9 range: [1, 9] # inclusive beginning and ending values steps: - sumStep: assign: - sum: ${sum + v} - returnStep: return: ${sum} # sum is 45 ``` -------------------------------- ### Deploy datetime Cloud Function Source: https://github.com/googlecloudplatform/workflows-samples/blob/main/functions/datetime/README.md Deploys the 'datetime' Cloud Function using gcloud CLI. Ensure you have the Google Cloud SDK installed and authenticated. This command deploys a gen2 HTTP-triggered function written in Python 3.11 to the us-central1 region and allows unauthenticated access. ```sh gcloud functions deploy datetime \ --gen2 \ --trigger-http \ --entry-point getValue \ --runtime python311 \ --region us-central1 --allow-unauthenticated ``` -------------------------------- ### Get datetime Cloud Function URL Source: https://github.com/googlecloudplatform/workflows-samples/blob/main/functions/datetime/README.md Retrieves the invocation URL for the deployed 'datetime' Cloud Function using the gcloud CLI. This URL is needed to test the function's endpoint. ```sh gcloud functions describe datetime \ --gen2 \ --region us-central1 \ --format="value(serviceConfig.uri)" ``` -------------------------------- ### Read Firestore Document Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Reads a document from Firestore using an HTTP GET request with OAuth2 authentication. ```yaml - initialize: assign: - project: "myproject123" - collection: "myEntries" - document: "Report" - read_item: try: call: http.get args: url: ${"https://firestore.googleapis.com/v1/projects/"+project+"/databases/(default)/documents/"+collection+"/"+document} auth: type: OAuth2 result: document_value except: as: e steps: - is_the_key_found: switch: - condition: ${e.code == 404} next: document_not_found - condition: ${e.code == 403} next: auth_error next: document_found - document_not_found: return: "Document not found." - auth_error: return: "Authentication error." - document_found: return: ${document_value.body.fields.LastName.stringValue} ``` -------------------------------- ### Manage BigQuery Resources Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Demonstrates dataset creation, query execution, and table management using the BigQuery connector. ```yaml - init: assign: - project_id: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")} - dataset_id: "example_dataset" - table_id: "example_table" - query: "SELECT * FROM `bigquery-public-data.usa_names.usa_1910_2013` LIMIT 5000;" - create_dataset: call: googleapis.bigquery.v2.datasets.insert args: projectId: ${project_id} body: datasetReference: datasetId: ${dataset_id} projectId: ${project_id} - insert_table_into_dataset: call: googleapis.bigquery.v2.jobs.insert args: projectId: ${project_id} body: configuration: query: query: ${query} destinationTable: projectId: ${project_id} datasetId: ${dataset_id} tableId: ${table_id} create_disposition: "CREATE_IF_NEEDED" write_disposition: "WRITE_TRUNCATE" useLegacySql: false - delete_table_from_dataset: call: googleapis.bigquery.v2.tables.delete args: projectId: ${project_id} datasetId: ${dataset_id} tableId: ${table_id} - delete_dataset: call: googleapis.bigquery.v2.datasets.delete args: projectId: ${project_id} datasetId: ${dataset_id} ``` -------------------------------- ### Manage Cloud Storage Objects with Workflows Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt This workflow demonstrates how to interact with Cloud Storage, including creating buckets, uploading/downloading objects, and deleting them. Ensure the service account has necessary Storage permissions. ```yaml - init: assign: - project_id: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")} - bucket_name: "my-workflow-bucket" - encoded_object_name: ${text.url_encode("myfile.txt")} - create_bucket: call: googleapis.storage.v1.buckets.insert args: project: ${project_id} body: name: ${bucket_name} - upload_object_media: call: googleapis.storage.v1.objects.insert args: bucket: ${bucket_name} uploadType: "media" name: ${encoded_object_name} body: "hello world" - download_object_media: call: googleapis.storage.v1.objects.get args: bucket: ${bucket_name} object: ${encoded_object_name} alt: "media" result: object_data - delete_object: call: googleapis.storage.v1.objects.delete args: bucket: ${bucket_name} object: ${encoded_object_name} - delete_bucket: call: googleapis.storage.v1.buckets.delete args: bucket: ${bucket_name} ``` -------------------------------- ### Deploy and run a workflow using gcloud Source: https://github.com/googlecloudplatform/workflows-samples/blob/main/README.md Use these commands to deploy a YAML workflow definition and execute it, returning the result. ```sh WORKFLOW=myFirstWorkflow gcloud workflows deploy $WORKFLOW --source src/$WORKFLOW.workflows.yaml gcloud workflows run $WORKFLOW --format='value(result)' ``` -------------------------------- ### Perform Expressions and Calculations Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Demonstrates string concatenation, arithmetic operations, and type conversion within expressions. ```yaml # expression.workflows.yaml - get_message: assign: - name: "Harsha" - last_name: "Kapoor" - full_name: ${name+" "+last_name} - temperature_C: 27 - temperature_F: ${temperature_C * 9/5 + 32} - temperature_msg: ${"Current temperature is "+string(temperature_F)+" F"} - return_value: return: ${temperature_msg} ``` -------------------------------- ### Deploy and Execute Workflows with gcloud CLI Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Commands to deploy YAML workflow definitions and execute them with optional input parameters. ```bash # Deploy a workflow from YAML source WORKFLOW=myFirstWorkflow gcloud workflows deploy $WORKFLOW --source src/$WORKFLOW.workflows.yaml # Run the workflow and get results gcloud workflows run $WORKFLOW --format='value(result)' # Run workflow with input arguments gcloud workflows run quickstart \ --data='{"searchTerm":"cloud computing"}' \ --format='value(result)' # Deploy with specific service account gcloud workflows deploy $WORKFLOW \ --source src/$WORKFLOW.workflows.yaml \ --service-account=my-sa@project.iam.gserviceaccount.com ``` -------------------------------- ### Configure YAML by RedHat Schemas in VSCode Source: https://github.com/googlecloudplatform/workflows-samples/blob/main/jsonschema/README.md Add this configuration to your VSCode settings.json to enable schema support for YAML files via the RedHat extension. ```json { ... "yaml.schemas": { "file:///PATH/TO/SCHEMA/workflows.json": [ "*.workflows.yaml", "workflows.yaml" ] }, ... } ``` -------------------------------- ### Define and Call a Subworkflow Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Demonstrates how to define a reusable subworkflow and invoke it from a main workflow step. ```yaml main: steps: - first: call: hello args: input: "Kristof" result: some_output - second: return: ${some_output} hello: params: [input] steps: - first: return: ${"Hello "+input} ``` -------------------------------- ### Define Workflow Input Arguments Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Configures a workflow to accept input parameters at runtime using the params field. ```yaml # args.workflows.yaml main: params: [args] steps: - step1: assign: - outputVar: ${"Hello " + args.firstName + " " + args.lastName} - step2: return: ${outputVar} ``` -------------------------------- ### Manipulate Lists and Arrays Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Shows how to define lists and iterate through them using a loop structure. ```yaml # list.workflows.yaml - first_step: assign: - my_list1: [1, 2, 3] - my_list2: - 1 - 2 - 3 - my_list3: ["Grzegorz", "Irina", "Yufei"] # array.workflows.yaml - Concatenating array elements - define: assign: - array: ["foo", "ba", "r"] - result: "" - i: 0 - check_condition: switch: - condition: ${len(array) > i} next: iterate next: exit_loop - iterate: assign: - result: ${result + array[i]} - i: ${i+1} next: check_condition - exit_loop: return: concat_result: ${result} # Returns "foobar" ``` -------------------------------- ### Create Dictionaries and Maps Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Defines nested dictionary structures, including the use of dynamic keys. ```yaml # dictionary.workflows.yaml - createMap: assign: - dynamicKey: "MiddleName" - myMap: FirstName: "John" ${dynamicKey}: "Apple" LastName: "Smith" Age: 26 Address: Street: "Flower Road 12" City: "Superville" Country: "Atlantis" ``` -------------------------------- ### Schedule HTTP Tasks with Cloud Tasks Connector Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt This workflow schedules HTTP tasks for future execution using Cloud Tasks queues. It requires the project ID, location, queue name, and task details like URL, method, and body. The body is base64 encoded. ```yaml # connector_schedule_tasks.workflows.yaml - init_variables: assign: - project: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")} - location: ${sys.get_env("GOOGLE_CLOUD_LOCATION")} - queue: "testqueue" - taskURL: "https://somewhere.com/apiendpoint" - method: "POST" - body: "Hello world!" - start_task: call: googleapis.cloudtasks.v2.projects.locations.queues.tasks.create args: parent: ${"projects/" + project + "/locations/" + location + "/queues/" + queue} body: task: httpRequest: body: ${base64.encode(text.encode(body))} httpMethod: ${method} url: ${taskURL} scheduleTime: "2021-06-01T07:20:50.52Z" result: task_result - last: return: ${task_result.body} ``` -------------------------------- ### Assign Workflow Variables Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Initializes variables of various types including strings, integers, and doubles. ```yaml # vars.workflows.yaml - first_step: assign: - SomeName: "Sherlock" - AnotherName: "Ada" - SomeIntegerNumber: 27 - SomeDoubleNumber: 4.1 ``` -------------------------------- ### Compile and Validate JSON Schema Source: https://github.com/googlecloudplatform/workflows-samples/blob/main/jsonschema/README.md Verify that the JSON schema file itself is syntactically correct using the ajv compiler. ```sh ajv compile -c ajv-formats --spec=draft2019 -s /jsonschema/workflows.json ``` -------------------------------- ### Custom Retry Policy Configuration Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Configure custom retry behavior with specific max retries and exponential backoff parameters. Adjust delay and multiplier for desired retry strategy. ```yaml # error_retry_custom.workflows.yaml - read_item: try: call: http.get args: url: https://example.com/someapi result: api_response retry: predicate: ${http.default_retry_predicate} max_retries: 5 backoff: initial_delay: 2 max_delay: 60 multiplier: 2 ``` -------------------------------- ### Execute Embedded Steps in Switch Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Allows executing multiple steps within a single switch case branch. ```yaml # step_switch_embedded.workflows.yaml - step1: assign: - a: 1 - step2: switch: - condition: ${a==1} steps: - stepA: assign: - a: ${a+7} - stepB: return: ${"increase a to:"+string(a)} - step3: return: ${"default a="+string(a)} ``` -------------------------------- ### Implement Conditional Logic with Switch Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Uses switch statements to route execution flow based on conditional evaluations. ```yaml # step_conditional_jump.workflows.yaml - first_step: call: http.get args: url: https://www.example.com/callA result: first_result - where_to_jump: switch: - condition: ${first_result.body.SomeField < 10} next: small - condition: ${first_result.body.SomeField < 100} next: medium next: large - small: call: http.get args: url: https://www.example.com/SmallFunc next: end - medium: call: http.get args: url: https://www.example.com/MediumFunc next: end - large: call: http.get args: url: https://www.example.com/LargeFunc next: end ``` -------------------------------- ### Implement Parallel For Loop Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Processes list items concurrently using a parallel for loop with index tracking and shared result variables. ```yaml # parallel_for_in.workflows.yaml main: params: [] steps: - init: assign: - workflow_id: "translate" - texts_to_translate: - text: "hello world!" source: "en" target: "fr" - text: "No hablo espanol!" source: "es" target: "en" - translated: ["", ""] - parallel_translate: parallel: shared: [translated] for: in: ${texts_to_translate} index: i value: arg steps: - translate: call: googleapis.workflowexecutions.v1.projects.locations.workflows.executions.run args: workflow_id: ${workflow_id} argument: ${arg} result: r - set_result: assign: - translated[i]: ${r} - return: return: ${translated} ``` -------------------------------- ### Analyze Images with Cloud Vision API Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt This workflow uses the Cloud Vision API to perform image analysis, such as label detection. It requires an OAuth2 authentication and accepts a JSON object with image source and features in the arguments. The input format is specified in the comment. ```yaml # vision_annotation.workflows.yaml # Input: { "requests": [ { "image": { "source": { "gcsImageUri": "gs://bucket/image.jpg" } }, "features": [ { "type": "LABEL_DETECTION", "maxResults": 1 } ] } ] } main: params: [args] steps: - new_annotation: call: http.post args: url: "https://vision.googleapis.com/v1/images:annotate" auth: type: OAuth2 body: requests: ${args.requests} result: vision_response - return_result: return: ${vision_response.body.responses[0].labelAnnotations[0]} ``` -------------------------------- ### Configure Cloud Code YAML Schemas in VSCode Source: https://github.com/googlecloudplatform/workflows-samples/blob/main/jsonschema/README.md Add this configuration to your VSCode settings.json to map local schema files to specific workflow file patterns. ```json { ... "cloudcode.yaml.schemas": { "file:///PATH/TO/SCHEMA/workflows.json": [ "*.workflows.yaml", "workflows.yaml" ] }, ... } ``` -------------------------------- ### Error Handling with Try-Except Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Catch and handle exceptions with custom error handlers based on HTTP status codes. Uses a switch statement to differentiate error types. ```yaml # error_catch.workflows.yaml - read_item: try: call: http.get args: url: https://example.com/someapi auth: type: OIDC result: API_response except: as: e steps: - known_errors: switch: - condition: ${not("HttpError" in e.tags)} next: connection_problem - condition: ${e.code == 404} next: url_not_found - condition: ${e.code == 403} next: auth_problem - unhandled_exception: raise: ${e} - url_found: return: ${API_response.body} - connection_problem: return: "Connection problem; check URL" - url_not_found: return: "Sorry, URL wasn't found" - auth_problem: return: "Authentication error" ``` -------------------------------- ### Configure Built-in JSON Schemas in VSCode Source: https://github.com/googlecloudplatform/workflows-samples/blob/main/jsonschema/README.md Add this configuration to your VSCode settings.json to define local or remote schema associations for JSON files. ```json { ... "json.schemas": [ { "description": "Local Workflows Schema", "fileMatch": [ "*.workflows.json" ], "url": "./PATH/TO/SCHEMA/workflows.json" }, { "description": "SchemaStore.org", "fileMatch": [ "workflows.json", "*.workflows.json", ], "url": "https://json.schemastore.org/workflows.json" } ], ... } ``` -------------------------------- ### Cloud Run Integration with OIDC Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Call Cloud Run services with OIDC authentication for secure service-to-service communication. Includes query parameters in the request. ```yaml # connect_run.workflows.yaml - call_my_function: call: http.get args: url: https://example-12345-ew.a.run.app auth: type: OIDC query: some_val: "Hello World" another_val: 123 result: the_message - return_value: return: ${the_message.body} ``` -------------------------------- ### Parallel Aggregation with BigQuery Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Execute parallel queries against BigQuery and aggregate results using shared variables. Ensure BigQuery API is enabled. ```yaml # parallel_aggregate.workflows.yaml main: params: [input] steps: - init: assign: - numWords: 0 - corpuses: - sonnets - various - comedyoferrors - runQueries: parallel: shared: [numWords] for: value: corpus in: ${corpuses} steps: - runQuery: call: googleapis.bigquery.v2.jobs.query args: projectId: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")} body: useLegacySql: false query: ${"SELECT COUNT(DISTINCT word) FROM `bigquery-public-data.samples.shakespeare` WHERE corpus='" + corpus + "' "} result: query - add: assign: - numWords: ${numWords + int(query.rows[0].f[0].v)} - done: return: ${numWords} ``` -------------------------------- ### Validate Workflow Syntax Source: https://github.com/googlecloudplatform/workflows-samples/blob/main/jsonschema/README.md Use ajv-cli to validate a specific workflow file against the local schema definition. ```sh ajv validate -c ajv-formats --spec=draft2019 \ -s /jsonschema/workflows.json \ -d ``` -------------------------------- ### Generate JSON from YAML Source: https://github.com/googlecloudplatform/workflows-samples/blob/main/CONTRIBUTING.md Execute the shell script to convert YAML files into JSON format. ```bash ./tojson.sh ``` -------------------------------- ### Perform HTTP POST Request Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Sends an HTTP POST request with a JSON body payload. ```yaml # http_post.workflows.yaml - send_message: call: http.post args: url: https://www.example.com/endpoint body: some_val: "Hello World" another_val: 123 result: the_message - return_value: return: ${the_message.body} ``` -------------------------------- ### Iterate over List Elements Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Uses the 'in' keyword to iterate through items in a list. ```yaml # iterate_list.workflows.yaml - assignStep: assign: - list: [1, 2, 3, 4, 5] - sum: 0 - loopStep: for: value: v in: ${list} steps: - getStep: assign: - sum: ${sum + v} - returnStep: return: ${sum} # sum is 15 ``` -------------------------------- ### Publish Pub/Sub Message Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Publishes a message to a Pub/Sub topic, requiring base64 encoding of the message data. ```yaml - init_variables: assign: - project: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")} - topic: "mytopic1" - message: "Hello world!" - publish: call: googleapis.pubsub.v1.projects.topics.publish args: topic: ${"projects/" + project + "/topics/" + topic} body: messages: - data: ${base64.encode(text.encode(message))} result: publish_result - last: return: ${publish_result} ``` -------------------------------- ### Translate Text using Cloud Translation API Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt This workflow integrates with the Cloud Translation API to translate text. It uses OAuth2 authentication and requires the Google Cloud Project Number. The source and target languages are specified in the request. ```yaml # connect_translate.workflows.yaml main: params: [args] steps: - new_translation: call: http.post args: url: ${"https://translation.googleapis.com/v3/projects/"+sys.get_env("GOOGLE_CLOUD_PROJECT_NUMBER")+ ":translateText"} auth: type: OAuth2 body: contents: ${args.textToTranslate} sourceLanguageCode: "en-US" targetLanguageCode: "ru-RU" result: translate_response - assign_translation: assign: - translation_result: ${translate_response.body.translations[0].translatedText} - return_result: return: ${translation_result} ``` -------------------------------- ### Iterate over Map Keys Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Accesses map values by iterating over keys using the keys() function. ```yaml # iterate_map.workflows.yaml - assignStep: assign: - map: 1: 10 2: 20 3: 30 - sum: 0 - loopStep: for: value: key in: ${keys(map)} steps: - sumStep: assign: - sum: ${sum + map[key]} - returnStep: return: ${sum} # sum is 60 ``` -------------------------------- ### Execute Parallel Branches Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Runs independent operations concurrently while sharing variables between branches. ```yaml # parallel_branch.workflows.yaml main: params: [args] steps: - init: assign: - user: {} - notification: {} - parallelStep: parallel: shared: [user, notification] branches: - getUser: steps: - getUserCall: call: http.get args: url: ${"https://example.com/users/" + args.userId} result: user - getNotification: steps: - getNotificationCall: call: http.get args: url: ${"https://example.com/notification/" + args.notificationId} result: notification ``` -------------------------------- ### Default Retry Policy for HTTP Requests Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Automatically retry failed HTTP requests using the built-in default retry policy. This is useful for transient network issues. ```yaml # error_retry.workflows.yaml - read_item: try: call: http.get args: url: https://example.com/someapi result: apiResponse retry: ${http.default_retry} ``` -------------------------------- ### Cloud Functions Integration with OIDC Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Invoke Cloud Functions with OIDC authentication and JSON request bodies. Uses HTTP POST method for invocation. ```yaml # connect_functions.workflows.yaml - call_my_function: call: http.post args: url: https://us-central1-myproject123.cloudfunctions.net/myfunc1 auth: type: OIDC body: some_val: "Hello World" another_val: 123 result: the_message - return_value: return: ${the_message.body} ``` -------------------------------- ### Write Firestore Document Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Updates or writes a document in Firestore using an HTTP PATCH request. ```yaml - initialize: assign: - project: "myproject123" - collection: "myEntries" - document: "Visits" - write_item: call: http.request args: url: ${"https://firestore.googleapis.com/v1/projects/"+project+"/databases/(default)/documents/"+collection+"/"+document} auth: type: OAuth2 method: PATCH body: name: ${"projects/"+project+"/databases/(default)/documents/"+collection+"/"+document} fields: Counter: integerValue: 7 ``` -------------------------------- ### Custom Retry Predicate Definition Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Define a custom subworkflow to determine retry behavior based on specific error conditions. Logs error tags and returns true for retriable errors. ```yaml # error_retry_predicate.workflows.yaml main: steps: - read_item: try: call: http.get args: url: https://example.com/someapi result: api_response retry: predicate: ${my_own_predicate} max_retries: 5 backoff: initial_delay: 2 max_delay: 60 multiplier: 2 - last_step: return: "OK" my_own_predicate: params: [e] steps: - log_error_tags: call: sys.log args: data: ${e.tags} severity: "INFO" - what_to_repeat: switch: - condition: ${e.code == 202} return: true - otherwise: return: false ``` -------------------------------- ### Firestore Read with OAuth2 Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Read documents from Firestore with OAuth2 authentication and error handling for missing documents. This snippet demonstrates basic Firestore read operations. -------------------------------- ### Access Secret Manager Secret Source: https://context7.com/googlecloudplatform/workflows-samples/llms.txt Retrieves a secret version from Secret Manager and decodes the base64 payload. ```yaml - init_variables: assign: - project: ${sys.get_env("GOOGLE_CLOUD_PROJECT_NUMBER")} - secret: "test-secret" - version: 1 - get_secret: call: googleapis.secretmanager.v1.projects.secrets.versions.access args: name: ${"projects/" + project + "/secrets/" + secret + "/versions/" + string(version)} result: secret_result - store_secret: assign: - secret_value: ${text.decode(base64.decode(secret_result.payload.data))} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.