DocsWorkflowsComponentsStoragestorage:google:drive:read

storage:google:drive:read

Downloads one Google Drive file's metadata and content, using a connection resolved from the connections store.

Options

NameTypeDescription
connectionstringThe connection id to use; empty resolves the only google-drive connection
idstringThe drive file id to read, as returned by storage:google:drive:list

Outputs

NameTypeDescription
fileFileStorage.File the file's metadata
  ↳ idstringThe provider's file id
  ↳ namestringThe file name
  ↳ mime_typestringThe file's mime type
  ↳ sizeint64The file size in bytes
  ↳ modifiedstringThe last modification time in RFC 3339
  ↳ folderboolWhether the entry is a folder
contentstringThe file contents as a UTF-8 string
body[]byteThe file contents as raw bytes

Example

name: Read the newest Drive report
actions:
  - name: reports
    component: storage:google:drive:list
    vars:
      query: name contains 'report'
      limit: 1

  - name: report
    component: storage:google:drive:read
    vars:
      id: "{{ reports.files | first | key:'id' }}"

outputs:
  name: "{{ report.file.name }}"
  content: "{{ report.content }}"