ns: main
name: graph
title: 'Graph including a subgraph'
type: flow
nodes:
  -
    id: node1
    ns: world
    name: hello
    context:
      message: 'Hello World!'
  -
    id: node2
    ns: console
    name: log
  -
    id: subgraph1
    ns: sub
    name: graph1
links:
  -
    source:
      id: node1
      port: out
    target:
      id: node2
      port: msg
nodeDefinitions:
  sub:
    graph1:
      ns: sub
      name: graph1
      type: flow
      nodes:
        -
          id: subgraphNode1
          ns: world
          name: hello
      ports:
        input:
          IN:
            nodeId: subgraphNode1
            name: message
        output:
          OUT:
            nodeId: subgraphNode1
            name: out
  world:
    hello:
      name: hello
      ns: world
      ports:
        input:
          message:
            type: string
        output:
          out:
            type: string
      fn: "output = { out: $.get('message') }\n"
  console:
    log:
      name: log
      ns: console
      description: 'Console log'
      title: 'Console log'
      ports:
        input:
          msg:
            type: any
            title: 'Log message'
            description: 'Logs a message to the console'
        output: {  }
      fn: ""
