REST Resource: processes
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
資源:程序
表示透過指令碼編輯器、觸發條件、應用程式或 Apps Script API 啟動的單個指令碼程序執行作業。這與 Operation
資源不同,後者僅代表透過 Apps Script API 啟動的執行作業。
JSON 表示法 |
{
"projectName": string,
"functionName": string,
"processType": enum (ProcessType ),
"processStatus": enum (ProcessStatus ),
"userAccessLevel": enum (UserAccessLevel ),
"startTime": string,
"duration": string
} |
欄位 |
projectName |
string
執行中指令碼的名稱。
|
functionName |
string
啟動執行作業的函式名稱。
|
processType |
enum (ProcessType )
執行作業類型。
|
processStatus |
enum (ProcessStatus )
執行狀態。
|
userAccessLevel |
enum (UserAccessLevel )
執行指令碼的使用者存取層級。
|
startTime |
string (Timestamp format)
開始執行的時間。 RFC3339 世界標準時間「Zulu」的時間戳記格式,解析度為奈秒,且最多 9 個小數位數。範例:"2014-10-02T15:01:23Z" 和 "2014-10-02T15:01:23.045123456Z" 。
|
duration |
string (Duration format)
執行作業的執行時間長度。 持續時間以秒為單位,最多 9 個小數位數,結尾為「s 」。範例:"3.5s" 。
|
ProcessType
列舉 |
PROCESS_TYPE_UNSPECIFIED |
未指定類型。 |
ADD_ON |
系統已從外掛程式進入點啟動這項程序。 |
EXECUTION_API |
這項程序是透過 Apps Script API 啟動。 |
TIME_DRIVEN |
這項程序是從時間型觸發條件啟動。 |
TRIGGER |
這項程序是從以事件為準的觸發條件啟動。 |
WEBAPP |
這項程序是從網頁應用程式進入點啟動。 |
EDITOR |
這項程序是透過 Apps Script IDE 啟動。 |
SIMPLE_TRIGGER |
這項程序是從 G Suite 簡易觸發條件啟動。 |
BATCH_TASK |
此程序是以批次工作的形式啟動。 |
ProcessStatus
列舉 |
PROCESS_STATUS_UNSPECIFIED |
未指定狀態。 |
RUNNING |
程序正在執行中。 |
PAUSED |
程序已暫停。 |
COMPLETED |
這項程序已完成。 |
CANCELED |
程序已取消。 |
FAILED |
程序失敗, |
TIMED_OUT |
程序逾時, |
UNKNOWN |
程序狀態不明。 |
DELAYED |
程序有所延遲,正在等待配額。 |
UserAccessLevel
列舉 |
USER_ACCESS_LEVEL_UNSPECIFIED |
未指定使用者存取層級 |
NONE |
沒有存取權。 |
READ |
使用者擁有唯讀存取權, |
WRITE |
使用者有寫入權限。 |
OWNER |
這位使用者是擁有者。 |
方法 |
|
列出使用者或代表使用者執行的程序相關資訊,例如程序類型和目前狀態。 |
|
列出指令碼執行程序的相關資訊,例如程序類型和目前狀態。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eThe \u003ccode\u003eProcess\u003c/code\u003e resource represents a single script execution initiated from various sources like the script editor, triggers, applications, or the Apps Script API.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eProcess\u003c/code\u003e details include project and function names, execution type, status, user access level, start time, and duration.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eProcessType\u003c/code\u003e identifies how the process was started (e.g., add-on, API, trigger, web app).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eProcessStatus\u003c/code\u003e indicates the current state of the execution (e.g., running, paused, completed, failed).\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can programmatically list processes using methods like \u003ccode\u003elist\u003c/code\u003e and \u003ccode\u003elistScriptProcesses\u003c/code\u003e to gain insights into executions.\u003c/p\u003e\n"]]],[],null,["# REST Resource: processes\n\n- [Resource: Process](#Process)\n - [JSON representation](#Process.SCHEMA_REPRESENTATION)\n- [ProcessType](#ProcessType)\n- [ProcessStatus](#ProcessStatus)\n- [UserAccessLevel](#UserAccessLevel)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Process\n-----------------\n\nRepresentation of a single script process execution that was started from the script editor, a trigger, an application, or using the Apps Script API. This is distinct from the [`Operation`](/apps-script/api/reference/rest/v1/scripts/run#body.Operation) resource, which only represents executions started via the Apps Script API.\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"projectName\": string, \"functionName\": string, \"processType\": enum (/apps-script/api/reference/rest/v1/processes#ProcessType), \"processStatus\": enum (/apps-script/api/reference/rest/v1/processes#ProcessStatus), \"userAccessLevel\": enum (/apps-script/api/reference/rest/v1/processes#UserAccessLevel), \"startTime\": string, \"duration\": string } ``` |\n\n| Fields ||\n|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `projectName` | `string` Name of the script being executed. |\n| `functionName` | `string` Name of the function the started the execution. |\n| `processType` | `enum (`[ProcessType](/apps-script/api/reference/rest/v1/processes#ProcessType)`)` The executions type. |\n| `processStatus` | `enum (`[ProcessStatus](/apps-script/api/reference/rest/v1/processes#ProcessStatus)`)` The executions status. |\n| `userAccessLevel` | `enum (`[UserAccessLevel](/apps-script/api/reference/rest/v1/processes#UserAccessLevel)`)` The executing users access level to the script. |\n| `startTime` | `string (`[Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp)` format)` Time the execution started. A timestamp in RFC3339 UTC \"Zulu\" format, with nanosecond resolution and up to nine fractional digits. Examples: `\"2014-10-02T15:01:23Z\"` and `\"2014-10-02T15:01:23.045123456Z\"`. |\n| `duration` | `string (`[Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)` format)` Duration the execution spent executing. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `\"3.5s\"`. |\n\nProcessType\n-----------\n\nThe type of process, which defines how the process was started.\n\n| Enums ||\n|----------------------------|--------------------------------------------------------|\n| `PROCESS_TYPE_UNSPECIFIED` | Unspecified type. |\n| `ADD_ON` | The process was started from an add-on entry point. |\n| `EXECUTION_API` | The process was started using the Apps Script API. |\n| `TIME_DRIVEN` | The process was started from a time-based trigger. |\n| `TRIGGER` | The process was started from an event-based trigger. |\n| `WEBAPP` | The process was started from a web app entry point. |\n| `EDITOR` | The process was started using the Apps Script IDE. |\n| `SIMPLE_TRIGGER` | The process was started from a G Suite simple trigger. |\n| `MENU` | The process was started from a G Suite menu item. |\n| `BATCH_TASK` | The process was started as a task in a batch job. |\n\nProcessStatus\n-------------\n\nThe process status.\n\n| Enums ||\n|------------------------------|--------------------------------------------|\n| `PROCESS_STATUS_UNSPECIFIED` | Unspecified status. |\n| `RUNNING` | The process is currently running. |\n| `PAUSED` | The process has paused. |\n| `COMPLETED` | The process has completed. |\n| `CANCELED` | The process was cancelled. |\n| `FAILED` | The process failed. |\n| `TIMED_OUT` | The process timed out. |\n| `UNKNOWN` | Process status unknown. |\n| `DELAYED` | The process is delayed, waiting for quota. |\n\nUserAccessLevel\n---------------\n\nThe various user access levels.\n\n| Enums ||\n|---------------------------------|--------------------------------|\n| `USER_ACCESS_LEVEL_UNSPECIFIED` | User access level unspecified |\n| `NONE` | The user has no access. |\n| `READ` | The user has read-only access. |\n| `WRITE` | The user has write access. |\n| `OWNER` | The user is an owner. |\n\n| Methods ------- ||\n|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|\n| ### [list](/apps-script/api/reference/rest/v1/processes/list) | List information about processes made by or on behalf of a user, such as process type and current status. |\n| ### [listScriptProcesses](/apps-script/api/reference/rest/v1/processes/listScriptProcesses) | List information about a script's executed processes, such as process type and current status. |"]]