@classmethod<EOL><INDENT>def from_json(cls, text):<DEDENT>
d = json.loads(text)<EOL>meta = d.get('<STR_LIT>', {})<EOL>workflow = cls(name=meta.get('<STR_LIT:name>'), description=meta.get('<STR_LIT:description>'))<EOL>for workflow_input in d.get('<STR_LIT>', []):<EOL><INDENT>parameter_cls = Parameter.by_id(workflow_input['<STR_LIT:type>'])<EOL>args = [workflow_input['<STR_LIT:name>']]<EOL>kwargs = {'<STR_LIT>': True}<EOL>if workflow_input.get('<STR_LIT:args>'):<EOL><INDENT>args = workflow_input['<STR_LIT:args>'][<NUM_LIT:0>] + args<EOL>kwargs.update(workflow_input['<STR_LIT:args>'][<NUM_LIT:1>])<EOL>args, kwargs = parameter_cls.deserialize_args(args, kwargs)<EOL><DEDENT>workflow.inputs.append(parameter_cls(*args, **kwargs))<EOL><DEDENT>for node in d.get('<STR_LIT>', []):<EOL><INDENT>node_inputs = {}<EOL>for k, v in six.iteritems(node.get('<STR_LIT>', {})):<EOL><INDENT>node_inputs[k] = (v['<STR_LIT:source>'], v.get('<STR_LIT:input>') or v.get('<STR_LIT>'))<EOL><DEDENT>workflow.add_node(node['<STR_LIT:id>'], Task.by_name(node['<STR_LIT>'])(), node_inputs)<EOL><DEDENT>for output in d.get('<STR_LIT>', []):<EOL><INDENT>node = output['<STR_LIT>']<EOL>node_parameters = ParameterCollection(workflow.nodes_by_id[node[<NUM_LIT:0>]].task.outputs)<EOL>output_param = copy.copy(node_parameters.by_name[node[<NUM_LIT:1>]])<EOL>output_param.name = output['<STR_LIT:name>']<EOL>workflow.outputs.append(output_param)<EOL>workflow.map_output(node[<NUM_LIT:0>], node[<NUM_LIT:1>], output['<STR_LIT:name>'])<EOL><DEDENT>return workflow<EOL>
Return a new workflow, deserialized from a JSON string