How to run a BatchExport job on a custom defined function


I have a custom function that can be executed as follows. This function returns an array.

var spec = GetDemandForecastsSpec.make({‘itemFacilityInventoryParams’: ‘AH230320_DW01’, ‘start’: ‘2017-03-01’, ‘end’: ‘2017-04-01’})
var df = ItemFacilityInventoryParams.getDemandForecasts(spec)

I want to run a batch export job on this function. I created the following spec, and ran Export.startExport() on this spec.

    "type": {
        "name": "BatchExportSpec"
    "contentEncoding": "gzip", 
    "contentType": "json", 
    "deleteExisting": true, 
    "numFiles": 10, 
    "targetAction": {
        "type": {
            "name": "PartiallyAppliedAction"
        "actionName": "getDemandForecasts", 
        "args": {
            "spec": {
                "type": {
                    "name": "GetDemandForecastsSpec"
                "end": "2017-04-01", 
                "itemFacilityInventoryParams": "AH230320_DW01", 
                "start": "2017-03-01"
        "typeName": "ItemFacilityInventoryParams"
    "targetPath": "DeereInventoryOptimization_TestBatchExport"

I get a _C3ActionError:

_C3ActionError: Export Error : Action getDemandForecasts needs the first argument to have an ‘ids’ or a ‘filter’ field. For instance, argument of ‘fetch’, is of the type ‘FetchSpec’ which contains ‘filter’

What would be the correct spec for running this job?