Process a file (COM)




This method processes a file through a workflow based on the specified user agent.

Function prototype

[in] VARIANT ContentsToBeProcessed,
[in] VARIANT ContentsType,
[in] VARIANT UserAgent,
[in] VARIANT InArgsArray,
[out] VARIANT *OutDetail,
[out, retval] VARIANT *OutArgsArray




Data Type


Full path to the file to be processed



0: holds a file path (Currently this is ignored since only 0 is supported)



A string to identify the user. Used for mapping to a specific workflow.



0: Sync Flag - Reserved for future use.

1: Custom Ticket - Currently, only the integer range value is supported.

2: Password for Archives

3: Additional Logging Parameter - This is passed to the user description argument in ScanEx if scanning is enabled on the workflow. Reserved for future use.

4: File Display Path - The full path of the file from the source machine to display to the user after processing.

5: Disable Logging - Disallows Metadefender Core to log any file type analysis and scan results.

6: Caching Option

  • 0: disable to cache for the scan request

  • 1: enable to cache for the scan request

  • 2: disregard the existing cache

  • 3: use the global setting

7: Customized data sanitization location

8: Workflow name - If you specify a workflow name, it overrides the mapping logic of the UserAgent parameter for workflow selection. If this string is not empty it MUST match a workflow name. Workflow names can be retrieved from the Metadefender Core Management Console (Configuration → Workflows)

Safearray of variants with the following order

0: boolean

1: string

2: string

3: string

4: string

5. boolean

6. uint32

7. string

8. string


JSON result details string

Example JSON

{ "Ticket": "974989300" }

In case of error [e.g. "Server is too busy. Try again later." | "Invalid License" | "Daily scan limit reached" | "Failed to continue. unknown error" | "Invalid file path"] :

{ "Error": "Invalid License" }

In case of too many simultaneous scans:

{ "Error": " Exceeded maximum thread count" }



0: Custom Ticket - to be used to associate callback results

Safearray of variants with the following order

0: string

Note: When the Metadefender Core server is too busy, the HRESULT value returned will be E_OUTOFMEMORY

Creating workflow profiles

Many configurations are supported via workflow profiles. To access the Workflow tab on the Metadefender Core Management Console, go here: http://localhost:8008/management/workflow.