n8n workflow: Two Way Sync Pipedrive and MySQL

Nodes:
name: Compare Datasets
type: n8n-nodes-base.compareDatasets
parameters: resolve: includeBoth
mergeByFields: values: field1: email
field2: email
name: Schedule Trigger
type: n8n-nodes-base.scheduleTrigger
name: MySQL
type: n8n-nodes-base.mySql
parameters: query: SELECT id, name, email, phone, updated_on FROM contact
operation: executeQuery
alwaysOutputData: yes
name: Pipedrive
type: n8n-nodes-base.pipedrive
parameters: resource: person
operation: getAll
name: Create Person
type: n8n-nodes-base.pipedrive
parameters: name: ={{ $json["name"] }}
resource: person
additionalFields: email: ={{ $json["email"] }}
phone: ={{ $json["phone"] }}
name: Create Contact
type: n8n-nodes-base.mySql
parameters: table: __rl: yes
mode: list
value: contact
cachedResultName: contact
columns: name, email, phone
name: Date & Time
type: n8n-nodes-base.dateTime
parameters: value: ={{ $json["different"]["updated_on"]["input1"] }}
custom: yes
toFormat: YYYY-MM-DD HH:mm:ss
dataPropertyName: different.updated_on.input1
name: Update Contact
type: n8n-nodes-base.mySql
parameters: query: =UPDATE contact
SET name = '{{$json["name"]}}', phone= '{{$json["phone"]}}'
WHERE id = {{$json["id"]}};
operation: executeQuery
name: Set Input2
type: n8n-nodes-base.set
parameters: values: string: name: id
value: ={{ $json["different"]["id"] ? $json["different"]["id"]["input1"] : $json["same"]["id"] }}
name: name
value: ={{ $json["different"]["name"] ? $json["different"]["name"]["input2"] : $json["same"]["name"] }}
name: phone
value: ={{ $json["different"]["phone"] ? $json["different"]["phone"]["input2"] : $json["same"]["phone"] }}
name: Set Input1
type: n8n-nodes-base.set
parameters: values: string: name: id
value: ={{ $json["different"]["id"] ? $json["different"]["id"]["input2"] : $json["same"]["id"] }}
name: name
value: ={{ $json["different"]["name"] ? $json["different"]["name"]["input1"] : $json["same"]["name"] }}
name: phone
value: ={{ $json["different"]["phone"] ? $json["different"]["phone"]["input1"] : $json["same"]["phone"] }}
name: Update Person
type: n8n-nodes-base.pipedrive
parameters: personId: ={{ $json["id"] }}
resource: person
operation: update
updateFields: name: ={{ $json["name"] }}
phone: ={{ $json["phone"] }}
name: IF Data Changed
type: n8n-nodes-base.if
parameters: conditions: boolean: value1: ={{ !!$json["different"]["name"] || !!$json["different"]["phone"] }}
value2: yes
name: IF Updated On
type: n8n-nodes-base.if
parameters: conditions: dateTime: value1: ={{ $json["different"]["updated"]["input1"] }} {{ $json["different"]["updated_on"]["input1"] }}
value2: ={{ $json["different"]["updated"]["input2"] }} {{ $json["different"]["updated_on"]["input2"] }}
name: Set
type: n8n-nodes-base.set
parameters: values: string: name: id
value: ={{ $json["id"] }}
name: name
value: ={{ $json["name"] }}
name: email
value: ={{ $json["primary_email"] }}
name: phone
value: ={{ $json["phone"][0]["value"] }}
name: updated_on
value: ={{ $json["update_time"] }}
keepOnlySet: yes

Connections:
Set: main: node: Compare Datasets
type: main
MySQL: main: node: Compare Datasets
type: main
Pipedrive: main: node: Set
type: main
Set Input1: main: node: Update Person
type: main
Set Input2: main: node: Update Contact
type: main
Date & Time: main: node: IF Updated On
type: main
IF Updated On: main: node: Set Input1
type: main
node: Set Input2
type: main
IF Data Changed: main: node: Date & Time
type: main
Compare Datasets: main: node: Create Person
type: main
node: IF Data Changed
type: main
node: Create Contact
type: main
Schedule Trigger: main: node: MySQL
type: main