REST Resource: processes
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
资源:Process
表示从脚本编辑器、触发器、应用或使用 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 世界协调时间(UTC,即“祖鲁时”)格式,精确到纳秒,最多九个小数位。示例:"2014-10-02T15:01:23Z" 和 "2014-10-02T15:01:23.045123456Z" 。
|
duration |
string (Duration format)
执行所用的持续时间。 该时长以秒为单位,最多包含九个小数位,以“s ”结尾。示例:"3.5s" 。
|
ProcessType
枚举 |
PROCESS_TYPE_UNSPECIFIED |
未指定类型。 |
ADD_ON |
该流程是从插件入口点启动的。 |
EXECUTION_API |
该流程是使用 Apps Script API 启动的。 |
TIME_DRIVEN |
该流程是从基于时间的触发器启动的。 |
TRIGGER |
该流程是从基于事件的触发器启动的。 |
WEBAPP |
该流程是从 Web 应用入口点启动的。 |
EDITOR |
该过程是使用 Apps 脚本 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 |
用户是所有者。 |
方法 |
|
列出由用户或代表用户执行的进程的相关信息,例如进程类型和当前状态。 |
|
列出有关脚本的已执行进程的信息,例如进程类型和当前状态。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):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. |"]]