Google Firestore
Get, list dan query dokumen (filter, urutan, collection group) dengan JSON biasa atau nilai bertipe, create dan update (agent harus diizinkan), delete (hanya lewat node)
Beta v0.1.0 Node.js 6 aksi
Tentang
Plugin Graphrt untuk Google Cloud Firestore (native mode) lewat REST API v1. Dokumen dibaca dan ditulis sebagai JSON biasa, plugin yang mengonversi dari dan ke nilai bertipe Firestore. Tanpa dependensi npm, autentikasi Google memakai kode yang sama dengan plugin google-sheets (salinan identik di lib/).
Yang bisa dilakukan
- 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.
Aksi
Setiap aksi adalah langkah yang bisa ditambahkan ke workflow. Agent juga bisa memakai sebagian besar aksi sebagai tool.
- 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
Pengaturan
Graphrt menyalakan plugin dengan environment yang bersih. Hanya nilai ini yang sampai ke plugin, dan secret tidak masuk log.
-
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
Cara memakainya
Di Graphrt Desktop
- Buka Plugins dan cari Google Firestore.
- Klik Install lalu setujui.
- Ikuti langkah setup di halaman plugin, lalu tempel pengaturan yang dibutuhkan.
- Jelaskan pekerjaan yang membutuhkannya, dan builder menambahkan langkahnya.
Dengan 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" } }