Graphrt

Google Forms

Read forms and responses (paged, timestamp filters), create forms, batch edits and publish/close behind opt-ins, Pub/Sub watches node only (OAuth or service account)

Beta v0.1.0 Node.js 11 actions
Use in Graphrt Desktop

About

A Graphrt plugin for the Google Forms API v1: read forms and their responses, create forms, edit questions with batch updates, publish or close forms, and manage Pub/Sub watches for new responses. To find forms by name use google-drive (mimeType application/vnd.google-apps.form), to copy responses into a sheet use google-sheets.

What it can do

  • get_form: title, description, settings, questions (items[] with questionId), publishSettings and the respondent link responderUri
  • list_responses: submitted responses (answers keyed by questionId), up to 5,000 per page with limit and cursor, filter takes only timestamp > T or timestamp >= T (RFC 3339 UTC)
  • get_response: one response by responseId
  • create_form: a new empty form with a title (form_title, optionally unpublished, closed to responses)
  • batch_update: raw batchUpdate requests (createItem, updateItem, moveItem, deleteItem, updateFormInfo, updateSettings), with required_revision_id to fail when the form changed meanwhile
  • set_publish_settings: is_published and is_accepting_responses (accepting needs published)
  • list_watches, create_watch, renew_watch, delete_watch: Pub/Sub notifications for new responses (RESPONSES) or edits (SCHEMA), a watch lasts 7 days and each Cloud project may have one per event type per form
  • api_request: any other endpoint (GET only for agents)

Actions

Each action is a step you can add to a workflow. Agents can also use most of them as tools.

  • Get form google-forms.get_form
  • Create form google-forms.create_form
  • Batch update form google-forms.batch_update
  • Publish or close form google-forms.set_publish_settings
  • List responses google-forms.list_responses
  • Get response google-forms.get_response
  • List watches google-forms.list_watches
  • Create watch google-forms.create_watch
  • Renew watch google-forms.renew_watch
  • Delete watch google-forms.delete_watch
Show all 11 actions
  • Google Forms API request google-forms.api_request

Settings

Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.

  • GOOGLE_REFRESH_TOKEN
    OAuth refresh trio
  • GOOGLE_SERVICE_ACCOUNT_JSON
    Path to a service account key file (scopes forms.body and forms.responses.readonly), share each form with the service account's email
  • GOOGLE_ACCESS_TOKEN
    A ready access token (used only when neither of the above is set)
  • GOOGLE_FORMS_TOOL_ALLOW_EDIT
    1 lets agent tools call batch_update
  • GOOGLE_FORMS_TOOL_ALLOW_PUBLISH
    1 lets agent tools call set_publish_settings
  • GOOGLE_CLIENT_ID
  • GOOGLE_CLIENT_SECRET
  • GOOGLE_FORMS_TOOL_TOKEN_SOURCE

How to use it

In Graphrt Desktop

  1. Open Plugins and search for Google Forms.
  2. Click Install and approve it.
  3. Follow the setup steps on the plugin's page, then paste the settings it needs.
  4. Describe a job that needs it, and the builder adds the steps.
Plugins in Graphrt Desktop

With the CLI

terminal
$ graphrt plugin install google-forms
workflow.yaml
# New responses since a time, e.g. in a scheduled workflow
- id: fresh
  type: google-forms.list_responses
  form_id: "{{#start.form_id#}}"
  filter: "timestamp > {{#start.since#}}"
# Add a question to a form
- id: add_question
  type: google-forms.batch_update
  form_id: "{{#start.form_id#}}"
  requests:
    - createItem:
        item: { title: "Your email", questionItem: { question: { required: true, textQuestion: {} } } }
        location: { index: 0 }
Plugins in the docs