Parameter: Features Data Type: GPMultiValue:GPFeatureRecordSetLayer Display Name Features Description: Input feature set. Direction: esriGPParameterDirectionInput Default Value: Parameter Type: esriGPParameterTypeRequired Category: Parameter: Output Data Type: GPDataFile Display Name Output Description: Direction: esriGPParameterDirectionOutput Default Value: Parameter Type: esriGPParameterTypeDerived Category:
import sys, os, arcpy features = arcpy.GetParameter(0) output = os.path.join(arcpy.env.scratchWorkspace, "ssexport.shp") arcpy.CopyFeatures_management(features, output) arcpy.SetParameter(1, output)
Just in case someone else also visits this page: A few days ago I had the very same problem and it turned out to be a bug in ArcGIS Server, still present in 10.5.1.
Esri Inc. now records this as
BUG-000107968 -- Running geoprocessing service with more than 2000 output features causes geoprocessing failure with the error message "The workspace is not connected".
Please note that the text is not completely correct: It's the number of input features – not the number of output features – that causes problem.
I converted the thread from a discussion to a question, which typically gets more views/response. I will mark Ralf's answer as the correct answer since he listed the bug (and it still exists).
trbryan if you are still having issues and/or found a workaround, a summary would be helpful for others (and you can change the correct-answer selection if needed).
Are you running this through REST or SOAP? The bug details seem to imply that REST works, but SOAP is the problem.