spe-uob / 2021-AIWorkflow

IBM AI Workflow Project
https://ai-workflow.classroom-eu-gb-1-bx2-4x1-d4ceb080620f0ec34cd169ad110144ef-0000.eu-gb.containers.appdomain.cloud/
MIT License
2 stars 1 forks source link

Backend - Parse Workflow #105

Closed mitchLui closed 2 years ago

mitchLui commented 2 years ago

Currently the main function workflownew class in workflow.py is empty. That's because we didn't know what our input would look like.

Now we do:

{
  "id": "demo@0.1.0",
  "nodes": {
    "1": {
      "id": 1,
      "data": {
        "keywords": "IBM Cloud, VPC, Watson"
      },
      "inputs": {},
      "outputs": {
        "tweets": {
          "connections": [
            {
              "node": 3,
              "input": "tweets",
              "data": {}
            }
          ]
        }
      },
      "position": [
        0,
        800
      ],
      "name": "Search Twitter"
    },
    "2": {
      "id": 2,
      "data": {},
      "inputs": {
        "tweets": {
          "connections": [
            {
              "node": 3,
              "output": "tweets",
              "data": {}
            }
          ]
        }
      },
      "outputs": {
        "analyzed tweets": {
          "connections": [
            {
              "node": 4,
              "input": "analyzed tweets",
              "data": {}
            }
          ]
        }
      },
      "position": [
        600,
        800
      ],
      "name": "Tone Analyzer"
    },
    "3": {
      "id": 3,
      "data": {},
      "inputs": {
        "tweets": {
          "connections": [
            {
              "node": 1,
              "output": "tweets",
              "data": {}
            }
          ]
        }
      },
      "outputs": {
        "tweets": {
          "connections": [
            {
              "node": 2,
              "input": "tweets",
              "data": {}
            }
          ]
        }
      },
      "position": [
        300,
        800
      ],
      "name": "Write to google sheets"
    },
    "4": {
      "id": 4,
      "data": {},
      "inputs": {
        "analyzed tweets": {
          "connections": [
            {
              "node": 2,
              "output": "analyzed tweets",
              "data": {}
            }
          ]
        }
      },
      "outputs": {
        "tweets": {
          "connections": []
        }
      },
      "position": [
        900,
        800
      ],
      "name": "Write to google slides"
    }
  }
}

With this we should be able to parse this into a workflow and run the actions.

Tasks:

mitchLui commented 2 years ago

Added an example workflow to the branch for your reference @SLZ0106

mitchLui commented 2 years ago
Screenshot 2022-04-01 at 13 06 35

Here's a frontend image to help you visualise it.

mitchLui commented 2 years ago

Put this back into in-progress because we now have to write the actual parsing code.