Added automation defmains and tests, plus integration tests for workflow