Input feature set schema
var featureSet = new esri.tasks.FeatureSet();
//get featurelayer from map's featurelayer (ex:myFeatureLayer)
//get features from featurelayer
featureSet.features = layer.graphics;
//assign fields property
//assign map's spatial reference
// Assumption: map variable is esri.Map instance in the application
Tip:The input feature sets created in web applications are usually in Web Mercator (wkid:4326) or Web Mercator Auxiliary Sphere (wkid:102100)) projections. However, the underlying model or script of the geoprocessing task may use other datasets as project data that are in a different spatial reference. In some cases, if the spatial reference of the input feature sets and the task's project data are different, the task may fail. This is due to the task author not anticipating receiving features in different spatial references than the project data. The Spatial reference considerations for geoprocessing services topic discusses some solutions for the task author to avoid such failures.
Output spatial reference (coordinate system)
The spatial reference of the output feature sets is dependent on the input parameters and other datasets that are used in the model or script. Web applications assume the spatial reference of the output features are in the same spatial reference as its map instance (esri.Map). Hence, the features may not be rendered as expected. To avoid such ambiguities, you should set the outSpatialReference property of the geoprocessing instance to the map's spatial reference as shown in the code below. When the output spatial reference property is set, the server will return the output features sets in the requested outSpatialReference.
var gpTask = new esri.tasks.Geoprocessor( "http://<gp-task-url>"); //map is assumed to be the map instance of the web application gpTask.outSpatialReference=map.spatialReference;