Stay organized with collections
Save and categorize content based on your preferences.
This document explains how to view status events for Batch
jobs and tasks. Status events provide a history that you can use to analyze
jobs and often contain useful error messages that you can use for
troubleshooting.
Each job and each of its tasks have status events that are automatically
created by Batch while the job runs.
Each of these status events describe a state
change and details about why that state was reached.
To learn about job and task states, see
Job lifecycle.
Optionally, you can also configure a job to have custom status events, which
describe the progress of runnables.
To learn more about custom status events, see
Configure custom status events.
To get the permissions that
you need to view jobs and tasks,
ask your administrator to grant you the
Batch Job Viewer (roles/batch.jobsViewer) or Batch Job Editor (roles/batch.jobsEditor)
IAM role on the project.
For more information about granting roles, see Manage access to projects, folders, and organizations.
The following instructions explain how to view status events using the
Google Cloud console, gcloud CLI, and Batch API.
To use a client-library language, follow the steps to
view the details of a job or
view the details of a task
and then see the corresponding statusEvents[] field.
View the status events of a job
Console
To view the status events of a job in the current project using the
Google Cloud console, follow these steps:
In the Google Cloud console, go to the Job list page.
TASK_INDEX: the index of the task that you want to view
the details of. In a task group, the task index starts at 0 for the first
task and increases by 1 with each additional task. For example, a task
group that contains four tasks has the indexes 0, 1, 2, and 3.
TASK_GROUP_NAME: the name of the task group that
contains the task that you want to view the details of. The value must be
set to group0.
TASK_INDEX: the index of the task that you want to view
the details of. In a task group, the task index starts at 0 for the first
task and increases by 1 with each additional task. For example, a task
group that contains four tasks has the indexes 0, 1, 2, and 3.
What's next
To understand status events from Batch that describe errors, see
Troubleshooting.
If you want a more detailed history for your job, such as status events
for when runnables start and end,
configure custom status events.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eStatus events in Batch provide a history of state changes for jobs and tasks, including error messages for troubleshooting.\u003c/p\u003e\n"],["\u003cp\u003eBoth jobs and individual tasks within those jobs automatically generate status events that are created by Batch while the job runs and will describe state changes.\u003c/p\u003e\n"],["\u003cp\u003eYou can view job-level status events through the Google Cloud console, gcloud CLI, or Batch API, with the console only showing job-level events.\u003c/p\u003e\n"],["\u003cp\u003eTask-level status events can be accessed via the gcloud CLI or Batch API, and it is done by identifying the task by its index, location, job name, and task group name.\u003c/p\u003e\n"],["\u003cp\u003eCustom status events can be configured for a job to capture more granular progress of runnables.\u003c/p\u003e\n"]]],[],null,["# View a job's history through status events\n\nThis document explains how to view status events for Batch\njobs and tasks. Status events provide a history that you can use to analyze\njobs and often contain useful error messages that you can use for\ntroubleshooting.\n\nEach job and each of its tasks have status events that are automatically\ncreated by Batch while the job runs.\nEach of these status events describe a state\nchange and details about why that state was reached.\nTo learn about job and task states, see\n[Job lifecycle](/batch/docs/create-run-job#lifecycle).\nOptionally, you can also configure a job to have custom status events, which\ndescribe the progress of runnables.\nTo learn more about custom status events, see\n[Configure custom status events](/batch/docs/create-run-job-custom-status-events).\n\nBefore you begin\n----------------\n\n1. If you haven't used Batch before, review [Get started with Batch](/batch/docs/get-started) and enable Batch by completing the [prerequisites for projects and users](/batch/docs/get-started#prerequisites).\n2.\n\n To get the permissions that\n you need to view jobs and tasks,\n\n ask your administrator to grant you the\n\n\n Batch Job Viewer (`roles/batch.jobsViewer`) or Batch Job Editor (`roles/batch.jobsEditor`)\n IAM role on the project.\n\n\n For more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\n You might also be able to get\n the required permissions through [custom\n roles](/iam/docs/creating-custom-roles) or other [predefined\n roles](/iam/docs/roles-overview#predefined).\n\n\u003cbr /\u003e\n\nView status events\n------------------\n\nDifferent status events might appear at the job level\n([`statusEvents[]` field for the job](/batch/docs/reference/rest/v1/projects.locations.jobs#JobStatus.FIELDS.status_events))\nand task level\n([`statusEvents[]` field for each task](/batch/docs/reference/rest/v1/projects.locations.jobs.taskGroups.tasks#TaskStatus.FIELDS.status_events)).\n\nThe following instructions explain how to view status events using the\nGoogle Cloud console, gcloud CLI, and Batch API.\nTo use a client-library language, follow the steps to\n[view the details of a job](/batch/docs/view-jobs-tasks#describe-job) or\n[view the details of a task](/batch/docs/view-jobs-tasks#describe-task)\nand then see the corresponding `statusEvents[]` field.\n\n### View the status events of a job\n\n### Console\n\n| **Note:** The Google Cloud console only lists job-level status events.\n\nTo view the status events of a job in the current project using the\nGoogle Cloud console, follow these steps:\n\n1. In the Google Cloud console, go to the **Job list** page.\n\n [Go to Job list](https://console.cloud.google.com/batch/jobs)\n2. In the **Job name** column, click the name of a job.\n\n The **Job details** page opens.\n\n The **Details** tab is open by default.\n3. Click the **Events** tab.\n\n### gcloud\n\nTo view the status events of a job using the\ngcloud CLI, use the\n[`gcloud batch jobs describe` command](/sdk/gcloud/reference/batch/jobs/describe),\nand then see the `statusEvents[]` field. \n\n gcloud batch jobs describe \u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e: the name of an existing job.\n\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the [location](/batch/docs/locations)\n where the job exists.\n\n### API\n\nTo view the status events of a job using the\nBatch API, make a `GET` request to the\n[`jobs.get` method](/batch/docs/reference/rest/v1/projects.locations.jobs/get),\nand then see the `statusEvents[]` field. \n\n GET https://batch.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/jobs/\u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the\n [project ID](/resource-manager/docs/creating-managing-projects#identifying_projects)\n of the current project.\n\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the [location](/batch/docs/locations)\n where the job exists.\n\n- \u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e: the name of an existing job.\n\n### View the status events of a task\n\n### gcloud\n\nTo view the status events of a task using the gcloud CLI, use the\n[`gcloud batch tasks describe` command](/sdk/gcloud/reference/batch/tasks/describe),\nand then see the `statusEvents[]` field. \n\n gcloud batch tasks describe \u003cvar translate=\"no\"\u003eTASK_INDEX\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --job=\u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e \\\n --task_group=\u003cvar translate=\"no\"\u003eTASK_GROUP_NAME\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eTASK_INDEX\u003c/var\u003e: the index of the task that you want to view\n the details of. In a task group, the task index starts at 0 for the first\n task and increases by 1 with each additional task. For example, a task\n group that contains four tasks has the indexes `0`, `1`, `2`, and `3`.\n\n- \u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e: the name of an existing job.\n\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the [location](/batch/docs/locations) where\n the job exists.\n\n- \u003cvar translate=\"no\"\u003eTASK_GROUP_NAME\u003c/var\u003e: the name of the task group that\n contains the task that you want to view the details of. The value must be\n set to [`group0`](/batch/docs/get-started#restrictions).\n\n### API\n\nTo view the status events of a task using the Batch API,\nmake a `GET` request to the\n[`tasks.get` method](/batch/docs/reference/rest/v1/projects.locations.jobs.taskGroups.tasks/get),\nand then see the `statusEvents[]` field. \n\n GET https://batch.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/jobs/\u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e/taskGroups/\u003cvar translate=\"no\"\u003eTASK_GROUP_NAME\u003c/var\u003e/tasks/\u003cvar translate=\"no\"\u003eTASK_INDEX\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the\n [project ID](/resource-manager/docs/creating-managing-projects#identifying_projects)\n of the current project.\n\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the [location](/batch/docs/locations)\n where the job exists.\n\n- \u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e: the name of an existing job.\n\n- \u003cvar translate=\"no\"\u003eTASK_GROUP_NAME\u003c/var\u003e: the name of the task group that\n contains the task that you want to view the details of. The value must be\n set to [`group0`](/batch/docs/get-started#restrictions).\n\n- \u003cvar translate=\"no\"\u003eTASK_INDEX\u003c/var\u003e: the index of the task that you want to view\n the details of. In a task group, the task index starts at 0 for the first\n task and increases by 1 with each additional task. For example, a task\n group that contains four tasks has the indexes `0`, `1`, `2`, and `3`.\n\nWhat's next\n-----------\n\n- To understand status events from Batch that describe errors, see\n [Troubleshooting](/batch/docs/troubleshooting).\n\n- If you want a more detailed history for your job, such as status events\n for when runnables start and end,\n [configure custom status events](/batch/docs/create-run-job-custom-status-events).\n\n- Learn how to\n [analyze a job by using logs](/batch/docs/analyze-job-using-logs)."]]