Authoring web tools with ModelBuilder

Authoring and sharing a web tool means creating a tool or workflow and defining the input and output parameters and the location of any data used.

ModelBuilder is used to create, edit, and manage geoprocessing models. Models are workflows that string together sequences of geoprocessing tools, passing the output of one tool into another tool as input. ModelBuilder can be thought of as a visual programming language for building workflows and authoring geoprocessing tools.

If you are unfamiliar with models and ModelBuilder, see the What is ModelBuilder topic for a list of useful topics.

If you have an existing model with parameters that you can run successfully in ArcGIS Pro, you can share it as a web tool without modification. The remainder of this topic addresses the finer points of authoring tools in ModelBuilder.

Create history items from models

A tool must first be run successfully before it can be shared as a web tool. To create a history item, a model must be run as a tool. A history item is not created when you run a model in ModelBuilder.

Note:

In most cases, a model needs to have parameters. You can see an example of a model tool with parameters in A quick tour of authoring and sharing web tools. You can learn more about creating model tools in Create a model tool.

Output data

You can write output paths to almost any location when creating models. When the model tool is shared as a web tool, these output paths are updated so it can run on the server. The following information outlines some best practices for creating good model tools to be shared as web tools.

A technique to increase performance is to write both intermediate and output data to the memory workspace. When writing data memory, the tool does not write the output to disk. Instead, this information is stored in the system's RAM. This generally allows a web tool to run faster than one in which all outputs are written to disk.

Learn more about writing geoprocessing output to memory

Caution:

Do not write output datasets to memory if you plan on configuring your service so that your output data is drawn by a map image layer.

When you choose to view your web tool output as a map image layer, it is important to understand that there are two services created on the server: the geoprocessing service and the map service. These two services run independently of each other. When the tool runs, the geoprocessing service runs first. The map service then runs to draw the output. Because of this run order, the resultant map service needs datasets on disk produced by the geoprocessing service.

When using the output map image layer or a tool that must write its output to disk, there are variables that provide control over output locations. Two variables, %scratchGDB% and %scratchFolder%, can be used in a model to direct output to a file geodatabase or a folder. These variable exist in ArcGIS Pro and as web tools, and you can create output in them.

Note:

If you've written your model with full paths to data on disk, the sharing process updates the output paths in the model to reflect one of these variables depending on the data output type. The sharing process always maintains a path written to memory.

Get started with ModelBuilder

If you are unfamiliar with ModelBuilder, the following table lists topics that will help you get started:

Help topicContent

What is ModelBuilder?

ModelBuilder vocabulary

These topics provide an introduction to ModelBuilder.

Create a model tool

This tutorial provides the basics of creating a tool in ModelBuilder. A model tool is a model that exposes variables as parameters.