Can't create new workflow

I was getting this error when attempting to add or import workflows:

An unexpected error has occurred while opening the workflow. See the event log on the AOS and contact your system administrator to resolve the issue.

The information is incorrect as nothing is included in the event log. However the code here provided all the information I needed:

http://erpcoder.wordpress.com/tag/workflow/

All it did was put in some extra code in to return the actual CLR error object content which shows you the actual problem. In my case it was that the BCP account didn’t have access to AX (silly mistake… but even so).

Cheers