Integrating FussyData with n8n

This tutorial will walk you through creating your first FussyData + n8n integration to request and process Excel files automatically.

What is n8n?

n8n is a workflow automation tool that allows you to connect different services and automate processes using a visual interface.

Overview

This tutorial will:

  1. Create a Submission Request (for an Excel file following a specified schema) in FussyData.
  2. When an Excel file is submitted to the request, a n8n webhook will be called.
  3. This will trigger a HTTP Request to get the data of the Excel file that submitted as JSON.
  4. We will then process this data using Python.

Your final workflow setup will look like this:

n8n workflow creation

Prerequisites

Before starting, make sure you have:

1.1 Create New Workflow in n8n

  1. Open your n8n instance

  2. Click “New Workflow”
    n8n workflow setup

  3. Give it a name like “FussyData Integration”

  4. Create a Webhook, make sure it is of type POST, and note the URL (initially you can choose the test URL and repeat the steps later for the production url)
    n8n webhook setup

1.2 Log into FussyData

  1. Go to app.fussydata.com

  2. Log into your account

  3. Create a submission request, for instance by choosing “Excel to API”, uploading an Excel template, and finally click “Create File Request”.

  4. Go to “Webhooks” and add a new webhook for the n8n webhook url.
    new webhook

  5. Go to “Submission Requests”, and click “Details” for the newly created Submission Request. Click “Edit File Request” and add your new Webhook under “Linked Webhooks”.
    n8n linked webhook.png

  6. Choose “Submit File for this Request” (and if your n8n is in testing listening mode you should see the webhook triggered after uploading the Excel file) and upload your Excel file again (but this time as a submission).

n8n webhook test trigger.png

  1. If you uploaded a test file to your request, go to “Submissions” and click “Details” of your Submission Request. If your webhook worked, you should now see your webhook marked as success under “Latest webhook delivery attempts”. Note the URL under “Latest JSON API Call Example (Get Latest Submission Request Data as JSON)”, it will be of the form https://app.fussydata.com/api/v1/submission_request/uuid/get_latest_json?token_uuid=uuid. (If preferred, this URL can also be constructed without uploading a test file by fetching the API token from “API Tokens”) and the request uuid from the Submission Request “Details” URL.
    n8n webhook success.png

Step 2: Retrieve the data in n8n

2.1 Create New Workflow in n8n

  1. Connect the Webhook node top a new HTTP Request node, which calls the /get_latest_json URL noted above.
  2. Connect the HTTP Request node to a new Code node of type “Python (Beta)”. You can now process the data, for example, you can use this code as a template:
# For n8n Code node with Python (Beta)
output_items = []

for item in items:
    try:
        response_data = item.get('json', {})
        
        # Extract data
        schema = response_data.get('schema', {})
        data = response_data.get('data', [])
        metadata = response_data.get('metadata', {})
        
        # Get column names
        columns = schema.get('columns', [])
        column_names = [col.get('name', f'col_{i}') for i, col in enumerate(columns)]
        
        # Convert to structured format
        structured_data = []
        for row in data:
            row_dict = {}
            for i, col_name in enumerate(column_names):
                if i < len(row):
                    row_dict[col_name] = row[i]
            structured_data.append(row_dict)
        
        # Create analysis
        analysis = {
            'total_rows': len(structured_data),
            'total_columns': len(column_names),
            'column_names': column_names,
            'metadata': metadata
        }
        
        output_items.append({
            'json': {
                'success': True,
                'structured_data': structured_data,
                'analysis': analysis,
                'original_data': response_data
            }
        })
        
    except Exception as e:
        output_items.append({
            'json': {
                'success': False,
                'error': str(e),
                'error_type': type(e).__name__
            }
        })

return output_items
  1. You are done. Save your n8n workflow. Use this setup to trigger other workflows as appropriate.
    n8n workflow creation