Skip to content

WF² Second Approval with DOC²#

In some process you need a second approval for incoming documents. Here is how you can configure this in DOC².

In our example one user or group member approves an invoice, assigns it to a second user or group for review and approval to ensure the approval is granted correctly.

In Release 1.18.xxx.x or higher, you are able to use this advanced approval workflow to assign invoices to specific users or groups, depending on the total amount of the invoice.

With our new Approve/Reject node, you can use this workflow to automatically approve or reject invoices that have defined high or low totals, for example.

Approval

Examples#

First Approval workflow

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
},
"nodes": [
{
    "parameters": {
    "selection": "group",
    "group": ""
    },
    "name": "Assign Finance 5000",
    "type": "WF²-nodes-base.assignEmployee",
    "typeVersion": 1,
    "position": [
    620,
    80
    ],
    "id": "",
    "credentials": {

    }
},
{
    "parameters": {
    "conditions": {
        "number": [
        {
            "value1": "={{$json[\"fields_compact\"][\"total_amount\"]}}",
            "operation": "larger",
            "value2": 5000
        }
        ]
    },
    "combineOperation": "any"
    },
    "name": ">5000?",
    "type": "WF²-nodes-base.if",
    "typeVersion": 1,
    "position": [
    420,
    240
    ],
    "id": ""
},
{
    "parameters": {
    "conditions": {
        "number": [
        {
            "value1": "={{$node[\"First\"].json[\"fields_compact\"][\"total_amount\"]}}",
            "operation": "larger",
            "value2": 100
        }
        ]
    }
    },
    "name": ">100?",
    "type": "WF²-nodes-base.if",
    "typeVersion": 1,
    "position": [
    620,
    380
    ],
    "id": ""
},
{
    "parameters": {
    "selection": "group",
    "group": ""
    },
    "name": "Assign Finance 100",
    "type": "WF²-nodes-base.assignEmployee",
    "typeVersion": 1,
    "position": [
    800,
    240
    ],
    "id": "",
    "credentials": {

    }
},
{
    "parameters": {
    "document_type": "INVOICE",
    "status": "validated_pending_approval"
    },
    "name": "First",
    "type": "WF²-nodes-base.statusTrigger",
    "typeVersion": 1,
    "position": [
    240,
    240
    ],
    "webhookId": "",
    "id": "",
    "credentials": {

    }
},
{
    "parameters": {
    "doc_id": "={{$node[\"First\"].json[\"doc_id\"]}}",
    "todo": "approve"
    },
    "id": "",
    "name": "Approve/Reject Documents",
    "type": "WF²-nodes-base.approvereject",
    "typeVersion": 1,
    "position": [
    800,
    400
    ],
    "credentials": {

    }
}
],
"connections": {
">5000?": {
    "main": [
    [
        {
        "node": "Assign Finance 5000",
        "type": "main",
        "index": 0
        }
    ],
    [
        {
        "node": ">100?",
        "type": "main",
        "index": 0
        }
    ]
    ]
},
">100?": {
    "main": [
    [
        {
        "node": "Assign Finance 100",
        "type": "main",
        "index": 0
        }
    ],
    [
        {
        "node": "Approve/Reject Documents",
        "type": "main",
        "index": 0
        }
    ]
    ]
},
"First": {
    "main": [
    [
        {
        "node": ">5000?",
        "type": "main",
        "index": 0
        }
    ]
    ]
}
}

Second Approval workflow

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
{
  "nodes": [
    {
      "parameters": {
        "document_type": "INVOICE",
        "status": "approved_pending_second_approval"
      },
      "name": "Second",
      "type": "WF²-nodes-base.statusTrigger",
      "typeVersion": 1,
      "position": [
        600,
        520
      ],
      "webhookId": "",
      "id": "",
      "credentials": {

      }
    },
    {
      "parameters": {
        "selection": "group",
        "group": ""
      },
      "name": "Assign Head",
      "type": "WF²-nodes-base.assignEmployee",
      "typeVersion": 1,
      "position": [
        980,
        360
      ],
      "id": "",
      "credentials": {

      }
    },
    {
      "parameters": {
        "selection": "group",
        "group": ""
      },
      "name": "Assign Finance",
      "type": "WF²-nodes-base.assignEmployee",
      "typeVersion": 1,
      "position": [
        1160,
        520
      ],
      "id": "",
      "credentials": {

      }
    },
    {
      "parameters": {
        "doc_id": "={{$node[\"Second\"].json[\"doc_id\"]}}",
        "todo": "approve"
      },
      "id": "",
      "name": "Auto Approve",
      "type": "WF²-nodes-base.approvereject",
      "typeVersion": 1,
      "position": [
        1160,
        700
      ],
      "credentials": {

      }
    },
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{$node[\"Second\"].json[\"fields_compact\"][\"total_amount\"]}}",
              "operation": "larger",
              "value2": 100
            }
          ]
        },
        "combineOperation": "any"
      },
      "name": ">100",
      "type": "WF²-nodes-base.if",
      "typeVersion": 1,
      "position": [
        980,
        680
      ],
      "id": ""
    },
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{$json[\"fields_compact\"][\"total_amount\"]}}",
              "operation": "larger",
              "value2": 5000
            }
          ]
        },
        "combineOperation": "any"
      },
      "name": ">5000",
      "type": "WF²-nodes-base.if",
      "typeVersion": 1,
      "position": [
        780,
        520
      ],
      "id": ""
    }
  ],
  "connections": {
    "Second": {
      "main": [
        [
          {
            "node": ">5000",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    ">100": {
      "main": [
        [
          {
            "node": "Assign Finance",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Auto Approve",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    ">5000": {
      "main": [
        [
          {
            "node": "Assign Head",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": ">100",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}