common/archiver/gcloud/README.md
See https://cloud.google.com/docs/authentication#service-accounts to understand how is made the authentication against google cloud storage
Nowdays we support three different ways in order to let Temporal know where your google keyfile credentials are located
GOOGLE_APPLICATION_CREDENTIALS environment variableIf more than one credentials location is given, then Temporal will resolve the conflicts by the following priority:
GOOGLE_APPLICATION_CREDENTIALS > Temporal archival deployment.yaml > Google default credentials
Be sure that you have created your bucket first, and have enought rights in order to read/write over your bucket.
Enabling archival is done by using the configuration below. credentialsPath is required but could be empty "" in order to allow a Google default credentials.
archival:
history:
state: "enabled"
enableRead: true
provider:
gstorage:
credentialsPath: "/tmp/keyfile.json"
visibility:
state: "enabled"
enableRead: true
provider:
gstorage:
credentialsPath: "/tmp/keyfile.json"
namespaceDefaults:
archival:
history:
state: "enabled"
URI: "gs://my-bucket-cad/temporal_archival/development"
visibility:
state: "enabled"
URI: "gs://my-bucket-cad/temporal_archival/visibility"
You can query the visibility store by using the tctl workflow listarchived command
The syntax for the query is based on SQL
Supported column names are
One of these fields are required, StartTime or CloseTime and they are mutually exclusive and also SearchPrecision.
Searching for a record will be done in times in the UTC timezone
SearchPrecision specifies what range you want to search for records. If you use SearchPrecision = 'Day'
it will search all records starting from 2020-01-21T00:00:00Z to 2020-01-21T59:59:59Z
=Searches the first 20 records for a given day 2020-01-21
./tctl --ns samples-namespace workflow listarchived -ps="20" -q "StartTime = '2020-01-21T00:00:00Z' AND SearchPrecision='Day'"
Once you have a workflowId and a runId you can retrieve your workflow history.
example:
./tctl --ns samples-namespace workflow show -w workflow-id -r runId