belarr-test

EmotionLogic community nodes for n8n

Package Information

Released: 2 mo ago
Downloads: 0 weekly / 0 monthly
Latest Version: 0.1.0

Documentation

n8n-nodes-emotionlogic

Community node package that exposes the public EmotionLogic AppTone and FeelGPT APIs in n8n.

Requirements

  • Node.js 20 or newer
  • An EmotionLogic API user with the required AppTone or FeelGPT permissions
  • An n8n instance that allows community packages or custom extensions

Build and test

cd projects/emlo/backend/apiGatewayService/packages/n8n
npm install
npm run lint
npm test
npm run build

Credentials

Create an EmotionLogic API credential in n8n:

Field Value
Base URL https://api.emotionlogic.ai/apigateway-service
Email EmotionLogic API user email
Password EmotionLogic API user password

The credential uses HTTP Basic authentication. Credentials are stored by n8n and are never embedded in workflow parameters.

When n8n runs in Docker and the API gateway runs on the host, use a base URL such as:

http://host.docker.internal:3200

Supported operations

AppTone

  • List Questionnaires
  • Send to Customer
  • Get Analysis Result
  • Cancel Report
  • Download PDF
  • Download Audio

The asynchronous operations require either a callback URL or callback email. Download PDF and Download Audio require a callback URL.

FeelGPT

  • List Advisors
    • Optional language and advisor ID filters
    • items, text, and raw output formats
    • Optional active-only filter and result limit
  • Analyze
    • Reads media from an n8n binary input field
    • Sends multipart/form-data
    • Requires audio language, analysis language, and a callback URL or email

A typical Analyze workflow is:

Read/Download File -> EmotionLogic FeelGPT Analyze -> Store reportId

The default binary field is data.

Local n8n demo

Build the package and start the included n8n instance:

npm install
npm run build
docker compose up -d

Open http://localhost:5678, then import:

demo/emotionlogic-list-advisors.workflow.json
demo/emotionlogic-analyze-with-pdf-callback.workflow.json

Assign an EmotionLogic API credential to List FeelGPT Advisors and execute the workflow.

Analyze a webhook file and receive the PDF

The second demo contains two webhook branches:

File Webhook -> EmotionLogic Analyze -> Respond 202

Analysis Callback Webhook -> Keep pdfReady callbacks -> Convert payload.pdf to binary PDF

After importing the workflow:

  1. Assign an EmotionLogic API credential to Analyze and Generate PDF.

  2. Activate the workflow. The production webhook is not registered while the workflow is inactive.

  3. Send a multipart request with a file field and an EmotionLogic advisor application ID:

    curl -X POST \
      "http://localhost:5678/webhook/emotionlogic-analyze-pdf?appId=YOUR_APP_ID&audioLanguage=en&analysisLanguage=en" \
      -F "file=@./recording.mp3"
    
  4. The upload request returns HTTP 202 after EmotionLogic accepts the analysis.

  5. EmotionLogic sends status callbacks to the second webhook. Non-PDF statuses complete without output.

  6. Open the callback execution whose Create PDF When Ready node has output, select Binary, and view or download data.

EmotionLogic sends the PDF as a base64 string in payload.pdf; the Code node converts it to binary with MIME type application/pdf. Leave Encryption Key empty for this demo.

The Analyze node derives the callback URL by replacing the upload webhook path with emotionlogic-analysis-callback. For a cloud EmotionLogic API, configure n8n's WEBHOOK_URL as a publicly reachable HTTPS URL; localhost cannot receive callbacks from an external service.

After changing node code:

npm run build
docker compose restart n8n

The compose file mounts this directory at /home/node/.n8n/custom/n8n-nodes-emotionlogic and enables custom extensions.

Install in another self-hosted n8n instance

After the package is published:

  1. Open Settings → Community Nodes.
  2. Select Install.
  3. Enter n8n-nodes-emotionlogic.
  4. Confirm installation and restart n8n if required.

For a local unpublished build, mount the package directory under N8N_CUSTOM_EXTENSIONS as shown in docker-compose.yml.

Publishing to npm

Publishing is intentionally not performed by this repository task. Before the first release:

  1. Confirm ownership of the n8n-nodes-emotionlogic npm package name.

  2. Set the intended license and repository metadata in package.json.

  3. Change private to false.

  4. Authenticate with npm:

    npm login
    
  5. Validate the package:

    npm run lint
    npm test
    npm run build
    npm pack --dry-run
    
  6. Publish:

    npm publish --access public
    

The package name must start with n8n-nodes-, retain the n8n-community-node-package keyword, and include the n8n.nodes and n8n.credentials dist paths.

Troubleshooting

Node does not appear

Run npm run build, verify that dist/ contains the node and credential files, then restart n8n.

Unable to connect

Check the Base URL and network routing. From an n8n Docker container, localhost points to the container; use host.docker.internal for a host API gateway.

Authentication or permission errors

Use an API user, not an interactive application user. AppTone operations require apptone_read; FeelGPT operations require feelgpt_app_usage.

Analyze has no binary input

Add a node that produces binary data before EmotionLogic and set Input Binary Field to its binary property name.

License

UNLICENSED

Discussion