{
  "workflow": {
    "id": 3282,
    "name": "Create notes and comments on any Odoo model record",
    "views": 1489,
    "recentViews": 0,
    "totalViews": 1489,
    "createdAt": "2025-03-21T17:49:37.686Z",
    "description": "## Introduction\nThis workflow is designed to create and attach notes or comments to any record in your Odoo instance. It acts as a sub-workflow that can be triggered by a main workflow to log messages or comments in a centralized manner. By leveraging the powerful Odoo API, this template ensures that updates to records are handled efficiently, providing an organized way to document important information related to your business processes.\n\n## Setup Instructions\nImport the Workflow:\n\nImport the provided JSON file into your n8n instance.\n\n## Odoo Credentials:\n\nEnsure you have valid Odoo API credentials (e.g., \"Roodsys Odoo Automation Account\") configured in n8n.\n\n## Node Configuration:\n\nVerify that the \"Odoo\" node (consider renaming it to \"Odoo Record Manager\" for clarity) is set up with your server details and authentication parameters.\n\nCheck that the workflow trigger (\"When Executed by Another Workflow\") is configured to receive input parameters from the parent workflow.\n\n## Execution Trigger:\n\nThis workflow is designed to be initiated by another workflow. Make sure the main workflow supplies the required inputs.\n\n### Workflow Details\nTrigger Node:\nThe workflow begins with the \"When Executed by Another Workflow\" node, which accepts three inputs:\n\nrec_id: A numeric identifier for the Odoo record.\n\nmessage: The text of the comment or note.\n\nmodel: The specific Odoo model (e.g., rs.deployment.action.log) where the note should be attached.\n\n### Odoo Node:\nThe second node in the workflow calls the Odoo API to create a new log message. It maps the inputs as follows:\n\nmessage_type is set to \"comment\".\n\nmodel is assigned the provided model name.\n\nres_id is assigned the record ID (rec_id).\n\nbody is assigned the message content.\n\n# Additional Information:\nA sticky note node is included to provide a brief overview of the workflow’s purpose directly within the interface.\n\n### Input Parameters\nRecord ID (rec_id):\nThe unique identifier of the record in Odoo where the note will be added.\n\n### Message (message):\nThe content of the comment or note that is to be logged.\n\n### Model (model):\nThe Odoo model name indicating the context in which the note should be created (e.g., rs.deployment.action.log).\n\n## Usage Examples\n### Internal Logging:\nUse the workflow to attach internal comments or logs to specific records, such as customer profiles, orders, or deployment logs.\n\n### Audit Trails:\nCreate a comprehensive audit trail by documenting changes or important events in Odoo records.\n\n### Integration with Other Workflows:\nLink this workflow with other automation processes in n8n (like email notifications, data synchronization, or reporting) to create a seamless integration across your systems.\n\n### Pre-conditions\nThe Odoo instance must be accessible and correctly configured.\n\nAPI permissions and user roles should be validated to ensure that the workflow has the necessary access rights.\n\nThe workflow expects inputs from an external trigger or parent workflow.\n\nCustomization & Integration\nThis template offers several customization options to tailor it to your needs:\n\nField Customization: Modify or add new fields to match your logging or commenting requirements.\n\nNode Renaming: Rename nodes for better clarity and consistency within your workflow ecosystem.\n\n**Integration Possibilities**: Easily integrate this workflow with other processes in n8n, such as triggering notifications or synchronizing data across different systems.\n\n\n\nThis sub-workflow receives data from a main workflow (for example, a record ID, a message, and the Odoo model) and creates a new note (or comment) in the corresponding Odoo record. Essentially, it acts as a centralized point for logging comments or notes in a specific Odoo model, ensuring that the information remains organized and easy to track.\n\nYour model must inherit from\n\n _inherit = ['portal.mixin', 'mail.thread.main.attachment']",
    "workflow": {
      "id": "g9L52eIw9UtmEKlk",
      "meta": {
        "instanceId": "1ed2ca0b20b27416028c1a74b1ee5a18d8b9a12cf5d27f153d2ae6fe9f4453d9",
        "templateCredsSetupCompleted": true
      },
      "name": "Send Log Message to Odoo",
      "tags": [],
      "nodes": [
        {
          "id": "aec2c855-0861-4757-a43e-2729d63973ea",
          "name": "When Executed by Another Workflow",
          "type": "n8n-nodes-base.executeWorkflowTrigger",
          "position": [
            0,
            0
          ],
          "parameters": {
            "workflowInputs": {
              "values": [
                {
                  "name": "rec_id",
                  "type": "number"
                },
                {
                  "name": "message"
                },
                {
                  "name": "model"
                }
              ]
            }
          },
          "typeVersion": 1.1
        },
        {
          "id": "30a07404-6aa2-4ea4-9edc-e558d551f611",
          "name": "Odoo",
          "type": "n8n-nodes-base.odoo",
          "position": [
            220,
            0
          ],
          "parameters": {
            "resource": "custom",
            "customResource": "={{ 'mail.message' }}",
            "fieldsToCreateOrUpdate": {
              "fields": [
                {
                  "fieldName": "message_type",
                  "fieldValue": "comment"
                },
                {
                  "fieldName": "model",
                  "fieldValue": "={{ $json.model }}"
                },
                {
                  "fieldName": "res_id",
                  "fieldValue": "={{ $json.rec_id }}"
                },
                {
                  "fieldName": "body",
                  "fieldValue": "={{ $json.message }}"
                }
              ]
            }
          },
          "credentials": {
            "odooApi": {
              "id": "credential-id",
              "name": "odooApi Credential"
            }
          },
          "typeVersion": 1
        },
        {
          "id": "b5c95ef2-66a7-4706-9ffb-9359133c889e",
          "name": "Sticky Note",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -580,
            -60
          ],
          "parameters": {
            "color": 6,
            "width": 400,
            "height": 260,
            "content": "## Creates a Note in an Odoo Record\nThis sub-workflow receives data from a main workflow (for example, a record ID, a message, and the Odoo model) and creates a new note (or comment) in the corresponding Odoo record. Essentially, it acts as a centralized point for logging comments or notes in a specific Odoo model, ensuring that the information remains organized and easy to track."
          },
          "typeVersion": 1
        }
      ],
      "active": false,
      "pinData": {
        "When Executed by Another Workflow": [
          {
            "json": {
              "model": "rs.deployment.action.log",
              "rec_id": 35,
              "message": "Test Message"
            }
          }
        ]
      },
      "settings": {
        "timezone": "America/Mexico_City",
        "callerPolicy": "workflowsFromSameOwner",
        "executionOrder": "v1",
        "executionTimeout": -1
      },
      "versionId": "0e263156-7239-4470-b8ad-2e46f832b74a",
      "connections": {
        "When Executed by Another Workflow": {
          "main": [
            [
              {
                "node": "Odoo",
                "type": "main",
                "index": 0
              }
            ]
          ]
        }
      }
    },
    "lastUpdatedBy": 29,
    "workflowInfo": {
      "nodeCount": 3,
      "nodeTypes": {
        "n8n-nodes-base.odoo": {
          "count": 1
        },
        "n8n-nodes-base.stickyNote": {
          "count": 1
        },
        "n8n-nodes-base.executeWorkflowTrigger": {
          "count": 1
        }
      }
    },
    "status": "published",
    "readyToDemo": null,
    "user": {
      "name": "Carlos Contreras",
      "username": "carlosecv",
      "bio": "Odoo Consultant for more than 15 years",
      "verified": false,
      "links": [
        "https://realsystems.com"
      ],
      "avatar": "https://gravatar.com/avatar/fa73debb34238cda02d54c64c9c7e1bc6257cb414cf5f2b1eaae12217e46ac02?r=pg&d=retro&size=200"
    },
    "nodes": [
      {
        "id": 559,
        "icon": "file:odoo.svg",
        "name": "n8n-nodes-base.odoo",
        "codex": {
          "data": {
            "alias": [
              "ERP"
            ],
            "resources": {
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.odoo/"
                }
              ],
              "credentialDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/credentials/odoo/"
                }
              ]
            },
            "categories": [
              "Data & Storage"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0"
          }
        },
        "group": "[\"transform\"]",
        "defaults": {
          "name": "Odoo"
        },
        "iconData": {
          "type": "file",
          "fileBuffer": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNTAiIGhlaWdodD0iMTUwIj48Y2lyY2xlIGN4PSI3NSIgY3k9Ijc1IiByPSI3Mi40IiBmaWxsPSIjOWM1Nzg5Ii8+PGNpcmNsZSBjeD0iNzUiIGN5PSI3NSIgcj0iNDIuNyIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg=="
        },
        "displayName": "Odoo",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 3,
            "name": "Data & Storage"
          }
        ]
      },
      {
        "id": 565,
        "icon": "fa:sticky-note",
        "name": "n8n-nodes-base.stickyNote",
        "codex": {
          "data": {
            "alias": [
              "Comments",
              "Notes",
              "Sticky"
            ],
            "categories": [
              "Core Nodes"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0",
            "subcategories": {
              "Core Nodes": [
                "Helpers"
              ]
            }
          }
        },
        "group": "[\"input\"]",
        "defaults": {
          "name": "Sticky Note",
          "color": "#FFD233"
        },
        "iconData": {
          "icon": "sticky-note",
          "type": "icon"
        },
        "displayName": "Sticky Note",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          }
        ]
      },
      {
        "id": 837,
        "icon": "fa:sign-out-alt",
        "name": "n8n-nodes-base.executeWorkflowTrigger",
        "codex": {
          "data": {
            "resources": {
              "generic": [],
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflowtrigger/"
                }
              ]
            },
            "categories": [
              "Core Nodes"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0",
            "subcategories": {
              "Core Nodes": [
                "Helpers"
              ]
            }
          }
        },
        "group": "[\"trigger\"]",
        "defaults": {
          "name": "When Executed by Another Workflow",
          "color": "#ff6d5a"
        },
        "iconData": {
          "icon": "sign-out-alt",
          "type": "icon"
        },
        "displayName": "Execute Workflow Trigger",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          }
        ]
      }
    ],
    "categories": [
      {
        "id": 45,
        "name": "Miscellaneous"
      }
    ],
    "image": []
  }
}