Network Analyst workflows can be automated by adding geoprocessing tools, data, and other elements to a model or Python script or by creating your own geoprocessing tools using models and scripts.
Create a geoprocessing model
The ArcGIS Network Analyst extension provides broad geoprocessing functionality through the Network Analyst toolbox. These geoprocessing tools can be chained in a model to automate repetitive tasks while reducing the probability of error. A model strings together a sequence of tools, using the output of one tool as the input to another tool.
Create a Python script
Python can be used to automate the execution of geoprocessing tools. The Network Analyst module is an ArcPy module that provides access to all the geoprocessing tools available in the Network Analyst toolbox as well as helper functions and classes that allow you to automate Network Analyst workflows through Python.
Create a script tool
You can turn a Python script into a geoprocessing tool by creating a script tool that looks and acts like a system geoprocessing tool. Once created, a script tool can be opened from the Catalog and Geoprocessing panes, used in ModelBuilder and the Python window, and called from another script.