Panduan ini memberikan contoh objek peristiwa Workspace Flows.
Alur mengirim parameter peristiwa dalam objek peristiwa add-on Google Workspace umum yang digunakan di seluruh add-on Google Workspace. Untuk mempelajari lebih lanjut objek peristiwa umum, lihat Objek peristiwa add-on Google Workspace.
Objek peristiwa alur mencakup objek berikut:
workflow: Peristiwa yang menjelaskan apa yang terjadi saat alur berjalan, dibuat, diperbarui, dihapus, atau resource kustom diminta. Bergantung pada apa yang terjadi, objek ini memiliki objek berikut:actionInvocation: Langkah berjalan.resourceRetrieval: Resource kustom diminta dari alur.
Tabel berikut menguraikan objek peristiwa mana yang diisi berdasarkan apa yang terjadi dalam alur:
| Objek Peristiwa | WorkflowAction | WorkflowResource |
|---|---|---|
actionInvocation |
OnExecuteFunction() Dipanggil saat OnExecuteFunction dipanggil pada Tindakan. |
t/a |
resourceRetrieval |
t/a | providerFunction() Dipanggil saat resource diminta dari Alur Kerja. |
actionInvocation
Sebagai referensi, berikut adalah contoh peristiwa alur yang menampilkan 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
Berikut adalah contoh peristiwa alur yang menampilkan 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"
}
}