Skip to content

Google Sheets: Create spreadsheet

Creates a new spreadsheet in the connected account’s Drive and returns its id and address.

  • A fresh spreadsheet per report, per customer or per month.
  • Setting up a sheet for a workflow’s first run, with its tabs named up front.

This action takes no spreadsheet_id. Every run creates another spreadsheet, and so can a step run a second time after Google made the first (a retry: after a lost answer, or an agent that lost its lease). Put it where a run reaches it once.

This action takes no with.

Field Type Required Description
title string yes The new spreadsheet’s name. It goes in the connected account’s Drive.
sheets array of string no Names for its sheets (tabs), in order, e.g. [“Orders”, “Summary”]. Empty: one sheet, Sheet1. Default [].

Beside with and input in the node’s config.

Field Type Required Description
credential string yes Name of the project credential the action authenticates with.
fail_on_error_status boolean no Treat any 4xx/5xx as a failure. On by default: an action either did its job or did not. Default true.
optional_when_untrusted boolean no Run without the credential when the run is untrusted (a fork pull request), instead of failing. The credential is still withheld.
retry_on array no Status codes that fail the node instead of returning, so its retry: policy applies (e.g. [429, 503]).

The HTTP response. The reply is under body: nodes.<id>.output.body.<field>.

Field Type Description
status integer The HTTP status code.
headers object The response headers.
body object The response body, parsed as JSON when it is JSON.
body.properties object
body.properties.title string
body.sheets array One entry per sheet, each with properties.title and properties.sheetId.
body.spreadsheetId string The new spreadsheet’s id, for the spreadsheet field of the steps that use it.
body.spreadsheetUrl string Its address, to open it in a browser.
  • On an agent with the connector capability. The managed environments have one, so this needs no agent of your own.
  • One POST request to sheets.googleapis.com.
  • Any 4xx or 5xx fails the step, unless fail_on_error_status is false. retry: asks again after a 5xx, a 401, 408, 409, 423, 425 or 429, or a 4xx with Retry-After, and not after any other 4xx, which would get the same answer.
  • 429 waited out and asked again with backoff, with no retry: on the step.
version: hyperspool-graph/v1
nodes:
- id: create
type: google-sheets.create_spreadsheet
config:
credential: sheets
input:
title: { $template: "Orders {{ input.month }}" }
sheets: [Orders, Summary]
- id: header
type: google-sheets.update_range
config:
credential: sheets
with:
spreadsheet_id: { $expr: "nodes.create.output.body.spreadsheetId" }
input:
range: Orders!A1
values: [[order_id, customer, total, status]]
edges:
- { from: create, to: header }

The new id is at nodes.<id>.output.body.spreadsheetId, ready for the spreadsheet_id of the steps below, and its address at body.spreadsheetUrl.

See Connectors for credentials and versions, and the node reference for every other node.