Panduan ini memberikan contoh objek peristiwa Workspace Studio.
Flow mengirim parameter peristiwa dalam objek peristiwa add-on Google Workspace umum yang digunakan di seluruh add-on Google Workspace. Untuk mempelajari objek peristiwa umum lebih lanjut, lihat Objek peristiwa add-on Google Workspace.
Objek peristiwa alur mencakup objek berikut:
workflow: Peristiwa yang menjelaskan apa yang terjadi saat alur berjalan, dibuat, diupdate, dihapus, atau resource kustom diminta. Bergantung pada apa yang terjadi, peristiwa ini memiliki objek berikut:actionInvocation: Langkah berjalan.resourceRetrieval: Resource kustom diminta dari alur.
Tabel berikut menguraikan objek peristiwa mana yang diisi berdasarkan tindakan alur:
| Objek peristiwa | Tindakan alur kerja | Resource alur kerja |
|---|---|---|
actionInvocation |
onExecuteFunction Dipanggil saat onExecuteFunction dipanggil pada tindakan. |
Tidak berlaku |
resourceRetrieval |
Tidak berlaku | providerFunction Dipanggil saat resource diminta dari alur kerja. |
actionInvocation
Contoh berikut menunjukkan peristiwa actionInvocation:
JSON
{
"workflow": {
"triggerEventSource": "TRIGGER_EVENT_SOURCE_AUTOMATED",
"actionInvocation": {
"inputs": {
"operation": {
"stringValues": [
"+"
]
},
"value2": {
"integerValues": [
2
]
},
"value1": {
"integerValues": [
2
]
}
}
}
},
"userLocale": "en",
"hostApp": "flows",
"clientPlatform": "web",
"commonEventObject": {
"timeZone": {
"offset": -14400000,
"id": "America/New_York"
},
"userLocale": "en-US",
"hostApp": "WORKFLOW",
"platform": "WEB"
},
"userCountry": "US",
"userTimezone": {
"id": "America/New_York",
"offSet": "-14400000"
}
}
resourceRetrieval
Contoh berikut menunjukkan peristiwa resourceRetrieval:
JSON
{
"workflow": {
"resourceRetrieval": {
"resourceReference": {
"resourceType": {
"workflowBundleId": "workflow_bundle_id",
"workflowResourceDefinitionId": "workflow_resource_definition_id"
},
"resourceId": "resource_id"
}
}
},
"userLocale": "en",
"hostApp": "flows",
"clientPlatform": "web",
"commonEventObject": {
"timeZone": {
"offset": -14400000,
"id": "America/New_York"
},
"userLocale": "en-US",
"hostApp": "WORKFLOW",
"platform": "WEB"
},
"userCountry": "US",
"userTimezone": {
"id": "America/New_York",
"offSet": "-14400000"
}
}