Google Firestore
Get, list and query documents (filters, ordering, collection groups) with plain JSON or typed values, create and update (agents opt-in), delete (node only)
Beta v0.1.0 Node.js 6 actions
About
A Graphrt plugin for Google Cloud Firestore (native mode) over the REST API v1. Documents are read and written as plain JSON, the plugin converts to and from Firestore's typed values. No npm dependencies, Google auth is the same code as the google-sheets plugin (byte-identical copies in lib/).
What it can do
- Reads: get_document, list_documents (paginated, order_by, field mask) and run_query (one collection or a collection group, where filters combined with AND, order_by, select, limit, offset).
- Writes: create_document (fails if it exists, give document_id so a retry cannot create a duplicate), update_document (merge the given top-level fields and remove delete_fields, or replace the whole document, must_exist by default) and delete_document (node only).
- Values (value_format: "plain", the default): null, booleans, integers, doubles, strings, arrays and maps map to their Firestore types. Other types use Firestore's own one-key form: {"timestampValue": "2026-11-19T10:00:00Z"}, {"bytesValue": "<base64>"}, {"referenceValue": "projects/p/databases/(default)/documents/users/u1"}, {"geoPointValue": {"latitude": -6.2, "longitude": 106.8}}, {"integerValue": "9007199254740993"} (exact int64), {"doubleValue": 2} (a whole-number double). Read back, integers too large for a JSON number stay strings, timestamps are RFC 3339 text. value_format: "typed" passes Firestore Value JSON through in both directions.
- Filter operators: ==, !=, <, <=, >, >=, array-contains, in, array-contains-any, not-in (or the API names such as GREATER_THAN), and IS_NULL, IS_NOT_NULL, IS_NAN, IS_NOT_NAN without a value.
- Full reference: OPERATIONS.md.
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- Get document
firestore.get_document - List documents
firestore.list_documents - Run query
firestore.run_query - Create document
firestore.create_document - Update document
firestore.update_document - Delete document
firestore.delete_document
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
GOOGLE_SERVICE_ACCOUNT_JSON(none)Path to a service account key file -
GOOGLE_REFRESH_TOKEN(none)OAuth refresh-token grant (scope https://www.googleapis.com/auth/datastore) -
GOOGLE_ACCESS_TOKEN(none)A ready access token (used first, replaced by a configured grant after a 401) -
FIRESTORE_PROJECT_ID(required)Project id -
FIRESTORE_DATABASE(default)Database id for named databases -
FIRESTORE_MAX_RESULT_BYTES4000000Most JSON bytes per call (1000 to 32000000). list_documents and run_query keep whole documents and report truncated and omitted_count (the omitted ones are skipped, so use a smaller limit or a mask/select), a single get_document over the cap returns only its metadata and field_names with truncated: true. -
FIRESTORE_TOOL_ALLOW_WRITES(off)1 lets agent tools call create_document and update_document -
GOOGLE_CLIENT_ID -
GOOGLE_CLIENT_SECRET -
GOOGLE_CLOUD_PROJECT
How to use it
In Graphrt Desktop
- Open Plugins and search for Google Firestore.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install firestore workflow.yaml
- id: vip_orders
type: firestore.run_query
collection_id: orders
where:
- { field: customer_tier, op: "==", value: vip }
- { field: total, op: ">=", value: 1000000 }
order_by: ["total desc"]
limit: 20
- id: note
type: firestore.update_document
path: "orders/{{#vip_orders.data.documents.0.id#}}"
fields: { followed_up: true, followed_up_at: { timestampValue: "2026-11-19T10:00:00Z" } }