
var createClient = require('./swf').createClient,
    WorkflowExecution = require('./workflow-execution').WorkflowExecution;

/**
 * Represents an Amazon WebService Simple Workflow
 * @constructor
 * @param {Object} config
 * @param {Object} [swfClient]
 */
var Workflow = exports.Workflow = function (config, swfClient) {
    this.config = config;
    this.swfClient = swfClient || createClient();
};

Workflow.prototype = {

    /**
     * Creates a new Workflow instance and start it
     * @param {Object} config
     * @param {Function} [cb] - called once the workflow execution started
     * @returns {WorkflowExecution} workflowExecution - The new instance of the workflow execution
     */
    start: function (config, cb) {
        var w = new WorkflowExecution(this.swfClient, this.config);
        w.start(config, cb);
        return w;
    },

    /**
     * register the workflow
     * @param {Function} [cb]
     */
    register: function (cb) {
        this.swfClient.client.registerWorkflowType({
            "domain": this.config.domain,
            "name": this.config.workflowType.name,
            "version": this.config.workflowType.version
        }, cb);
    }

};

@@ -851,16 +851,519 @@
     %7D,%0A%0A
+    /**%0A     * Just like %60start()%60, but callback passes the workflow execution with the%0A     * run ID with no return value%0A     * @param %7BObject%7D config%0A     * @param %7BFunction%7D %5Bcb%5D - called once the workflow execution started%0A     * @returns %7BWorkflowExecution%7D workflowExecution - The new instance of the workflow execution%0A     */%0A    startCb: function (config, cb) %7B%0A      var w = this.start(config, function (err, runId) %7B%0A        w.runId = runId;%0A        cb.call(this, err, w);%0A      %7D);%0A    %7D,%0A%0A
     /**%0A

Add alternative callback that would call with the execution