Google Sheets · Arazzo Workflow

Google Sheets Create With an Extra Sheet and Write

Version 1.0.0

Create a spreadsheet, add a second named sheet to it, then write values into that sheet.

1 workflow 1 source API 1 provider
View Spec View on GitHub Google WorkspaceProductivitySpreadsheetsArazzoWorkflows

Provider

google-sheets

Workflows

create-with-extra-sheet-and-write
Create a spreadsheet, add a second sheet, and write values into it.
Creates a spreadsheet, uses a batchUpdate addSheet request to add a second named tab, then sets values in a range on that new tab.
3 steps inputs: accessToken, newSheetTitle, range, title, values outputs: spreadsheetId, spreadsheetUrl, updatedCells, updatedRange
1
createSpreadsheet
createSpreadsheet
Create the spreadsheet and capture its generated spreadsheet ID.
2
addSheet
batchUpdateSpreadsheet
Apply a batchUpdate with a single addSheet request that creates a second tab using the supplied title.
3
writeValues
updateValues
Set the supplied values into the target range on the newly added sheet using USER_ENTERED interpretation.

Source API Descriptions

Arazzo Workflow Specification

google-sheets-create-with-extra-sheet-and-write-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Google Sheets Create With an Extra Sheet and Write
  summary: Create a spreadsheet, add a second named sheet to it, then write values into that sheet.
  description: >-
    A spreadsheet provisioning flow that goes beyond the default single tab.
    The workflow creates a new spreadsheet, applies a batchUpdate that adds a
    second named sheet via an addSheet request, and then writes a block of
    values into that new sheet's range. Every step spells out its request
    inline so the flow can be read and executed without opening the underlying
    OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: googleSheetsApi
  url: ../openapi/google-sheets-openapi.yml
  type: openapi
workflows:
- workflowId: create-with-extra-sheet-and-write
  summary: Create a spreadsheet, add a second sheet, and write values into it.
  description: >-
    Creates a spreadsheet, uses a batchUpdate addSheet request to add a second
    named tab, then sets values in a range on that new tab.
  inputs:
    type: object
    required:
    - accessToken
    - title
    - newSheetTitle
    - range
    - values
    properties:
      accessToken:
        type: string
        description: OAuth 2.0 bearer access token with the spreadsheets scope.
      title:
        type: string
        description: The title to give the newly created spreadsheet.
      newSheetTitle:
        type: string
        description: The title of the second sheet to add to the spreadsheet.
      range:
        type: string
        description: The A1 notation range to write values to (should reference the new sheet, e.g. NewTab!A1).
      values:
        type: array
        description: A two-dimensional array of cell values to write.
        items:
          type: array
          items: {}
  steps:
  - stepId: createSpreadsheet
    description: Create the spreadsheet and capture its generated spreadsheet ID.
    operationId: createSpreadsheet
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    requestBody:
      contentType: application/json
      payload:
        properties:
          title: $inputs.title
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      spreadsheetId: $response.body#/spreadsheetId
      spreadsheetUrl: $response.body#/spreadsheetUrl
  - stepId: addSheet
    description: >-
      Apply a batchUpdate with a single addSheet request that creates a second
      tab using the supplied title.
    operationId: batchUpdateSpreadsheet
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: spreadsheetId
      in: path
      value: $steps.createSpreadsheet.outputs.spreadsheetId
    requestBody:
      contentType: application/json
      payload:
        requests:
        - addSheet:
            properties:
              title: $inputs.newSheetTitle
        includeSpreadsheetInResponse: true
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      spreadsheetId: $response.body#/spreadsheetId
      replies: $response.body#/replies
  - stepId: writeValues
    description: >-
      Set the supplied values into the target range on the newly added sheet
      using USER_ENTERED interpretation.
    operationId: updateValues
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: spreadsheetId
      in: path
      value: $steps.createSpreadsheet.outputs.spreadsheetId
    - name: range
      in: path
      value: $inputs.range
    - name: valueInputOption
      in: query
      value: USER_ENTERED
    requestBody:
      contentType: application/json
      payload:
        range: $inputs.range
        majorDimension: ROWS
        values: $inputs.values
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      updatedRange: $response.body#/updatedRange
      updatedCells: $response.body#/updatedCells
  outputs:
    spreadsheetId: $steps.createSpreadsheet.outputs.spreadsheetId
    spreadsheetUrl: $steps.createSpreadsheet.outputs.spreadsheetUrl
    updatedRange: $steps.writeValues.outputs.updatedRange
    updatedCells: $steps.writeValues.outputs.updatedCells