{
  "type": "workflow_collections",
  "data": [
    {
      "@context": "/api/3/contexts/WorkflowCollection",
      "@type": "WorkflowCollection",
      "name": "10 - Utilities",
      "description": null,
      "visible": true,
      "image": null,
      "id": 76,
      "createDate": 1589786312,
      "modifyDate": 1589786312,
      "recordTags": [],
      "workflows": [
        {
          "@type": "Workflow",
          "triggerLimit": null,
          "name": "Reset DB Erase All Data from Database",
          "aliasName": null,
          "description": "This playbook will reset demo data",
          "collection": "/api/3/workflow_collections/20289298-cdd6-4052-8fa0-11e2603dca00",
          "tag": null,
          "isActive": true,
          "singleRecordExecution": false,
          "remoteExecutableFlag": false,
          "parameters": [],
          "synchronous": false,
          "triggerStep": "/api/3/workflow_steps/5ffd4d76-75ee-449e-ae70-76ff5490184b",
          "steps": [
            {
              "@type": "WorkflowStep",
              "name": "Delete Data",
              "description": null,
              "arguments": {
                "config": "532cb0c1-3a36-4324-b1d2-a6bc3754b984",
                "params": {
                  "python_function": "import psycopg2\n\nhostname = '127.0.0.1'\nusername = 'cyberpgsql'\npassword = ''\ndatabase = 'venom'\ntable_list = {{vars.table_list}}\n\n\ndef doQuery(conn):\n    curr = conn.cursor()\n    try:\n        for tables in table_list:\n            curr.execute(\"delete from {}\".format(tables))\n            conn.commit()\n    except (Exception, psycopg2.DatabaseError) as error:\n\n        print (error)\n\n\nmyConnection = psycopg2.connect(host=hostname, user=username,\n                                password=password, dbname=database)\ndoQuery(myConnection)\nmyConnection.close()"
                },
                "version": "1.2.1",
                "connector": "code-snippet",
                "operation": "python_inline",
                "operationTitle": "Execute Python Code",
                "step_variables": []
              },
              "status": null,
              "left": "125",
              "top": "300",
              "stepType": "/api/3/workflow_step_types/1fdd14cc-d6b4-4335-a3af-ab49c8ed2fd8",
              "uuid": "8e8ecee9-304d-4b49-87af-9044f8a72df1"
            },
            {
              "@type": "WorkflowStep",
              "name": "Configuration",
              "description": null,
              "arguments": {
                "table_list": "['alerts','incidents','indicators','tasks','campaigns','comments','hunt','emails','assets','users','vulnerabilities']"
              },
              "status": null,
              "left": "125",
              "top": "165",
              "stepType": "/api/3/workflow_step_types/04d0cf46-b6a8-42c4-8683-60a7eaa69e8f",
              "uuid": "3ead2e2a-86dd-4a18-b2cc-fc0b810d79d2"
            },
            {
              "@type": "WorkflowStep",
              "name": "Start",
              "description": "This playbook will delete all records from database",
              "arguments": {
                "route": "16160ebf-cff5-4413-90a4-3dc47de6fae8",
                "title": "Reset All Data from DB",
                "resources": [
                  "alerts"
                ],
                "inputVariables": [
                  {
                    "name": "confirmDeletion",
                    "type": "boolean",
                    "label": "Confirm Deletion",
                    "title": "Checkbox",
                    "usable": true,
                    "tooltip": "This will reset all data in this environment",
                    "dataType": "checkbox",
                    "formType": "checkbox",
                    "required": false,
                    "_expanded": true,
                    "collection": false,
                    "searchable": true,
                    "templateUrl": "app/components/form/fields/checkbox.html",
                    "defaultValue": false,
                    "allowedEncryption": false,
                    "allowedGridColumn": true,
                    "useRecordFieldDefault": false
                  }
                ],
                "step_variables": {
                  "input": {
                    "params": {
                      "confirmDeletion": "{{vars.request.data[\"confirmDeletion\"]}}"
                    },
                    "records": "{{vars.input.records}}"
                  }
                },
                "_promptexpanded": true,
                "displayConditions": {
                  "alerts": {
                    "sort": [],
                    "limit": 30,
                    "logic": "AND",
                    "filters": []
                  }
                },
                "executeButtonText": "Reset",
                "noRecordExecution": true,
                "singleRecordExecution": false
              },
              "status": null,
              "left": "125",
              "top": "30",
              "stepType": "/api/3/workflow_step_types/f414d039-bb0d-4e59-9c39-a8f1e880b18a",
              "uuid": "5ffd4d76-75ee-449e-ae70-76ff5490184b"
            }
          ],
          "routes": [
            {
              "@type": "WorkflowRoute",
              "uuid": "6238ed1d-9b17-4838-9bbf-fb88d34e0ada",
              "name": "Start -> Configuration",
              "label": null,
              "isExecuted": false,
              "targetStep": "/api/3/workflow_steps/3ead2e2a-86dd-4a18-b2cc-fc0b810d79d2",
              "sourceStep": "/api/3/workflow_steps/5ffd4d76-75ee-449e-ae70-76ff5490184b"
            },
            {
              "@type": "WorkflowRoute",
              "uuid": "611de1e3-9709-45f5-a40e-bc64ede95066",
              "name": "Configuration -> Delete Data",
              "label": null,
              "isExecuted": false,
              "targetStep": "/api/3/workflow_steps/8e8ecee9-304d-4b49-87af-9044f8a72df1",
              "sourceStep": "/api/3/workflow_steps/3ead2e2a-86dd-4a18-b2cc-fc0b810d79d2"
            }
          ],
          "versions": null,
          "lastModifyDate": 1598174002,
          "priority": null,
          "uuid": "78c28256-9bf5-49b0-9f1e-ee963c82e038",
          "recordTags": [
            "ManualAction"
          ],
          "isPrivate": false,
          "owners": []
        }
      ]
    }
  ]
}