This page shows you how to use an Google APIs Explorer template to update a Managed Service for Apache Spark cluster to change the number of workers in a cluster. Scaling a cluster up to include more workers is a common task when additional workers are needed to process larger jobs.
For other ways to update a Managed Service for Apache Spark cluster, see:
To update the number of workers in your cluster, fill in and execute the Google APIs Explorer Try this API template.
Request parameters:
numInstances parameter to be updated (see the Request body instructions).Request body:
Click EXECUTE. The first time you run the API template, you may be asked to choose and sign into your Google account, then authorize the Google APIs Explorer to access your account. If the request is successful, the JSON response shows that cluster update is pending.
To confirm that the number of workers in the cluster has been updated, open the Managed Service for Apache Spark Clusters page in the Google Cloud console and view the cluster's Total worker nodes column. You may need to click REFRESH at the top of the page to view the updated value after the cluster update completes.
To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.
You can use this quickstart template to restore the cluster to its previous
workerConfig.numInstances value.
Learn how to write and run a Spark Scala job.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-07-22 UTC.