Overview of the Network Analyst geoprocessing service examples
When authoring a geoprocessing tool that will be published as a geoprocessing service for solving network analysis layers, you need to start by asking yourself one yes-or-no question: Will the geoprocessing tool solve vehicle routing problems or service areas?
Yes
If the answer is yes, you can plan to add one of two geoprocessing tools to your model or script: Solve vehicle routing problem or Generate Service Areas. Read Geoprocessing service example: Drive-time polygons if you plan to publish one of these two kinds of tools.
Geoprocessing service example: Drive-time polygons and its companion tutorial data demonstrate how to create a tool for generating service areas on ArcGIS for Server. The tutorial media also provides sample data for setting up a vehicle routing problem service; however, a tutorial topic isn't provided. The workflows for configuring service area and vehicle routing problem services are similar, so read Geoprocessing service example: Drive-time polygons even if you intend to set up a vehicle routing problem service.
No
If the answer is no, this means you are publishing a geoprocessing tool based on one of the other ArcGIS Network Analyst extension solvers (Route, Closest Facility, OD Cost Matrix, or Location-Allocation), and you will need to chain a series of tools together in your model or script.
Geoprocessing service example: Shortest route on a street network and its companion tutorial data demonstrate how to create a model tool for finding best routes. Read this topic and look at its associated tutorial data if you plan to publish a routing model tool. If you plan to publish a service based on closest facility, OD cost matrix, or location-allocation, read this topic, but follow along using the provided tutorial data for these other solvers.