Integrate real-time data processing and take immediate action on submissions with Comfyform’s Webhooks. Set up endpoints to receive JSON-formatted POST requests directly from Comfyform, containing all necessary submission data. Whether you’re aiming to trigger workflows, update databases, or connect with other apps – webhooks provide a seamless conduit for automation.

Step by Step Guide

Easily integrate Comfyform into your service ecosystem. To use webhooks for connecting your forms to your server or another service, follow these steps:

  1. Access your Comfyform dashboard.
  2. Navigate to the Forms section and select the form you want to enable webhooks on.
  3. Click on the Notifications tab.
  4. Locate the Webhooks option and click “Activate”. To adjust an existing webhook, click “Modify”.
  5. Provide the URL of the server endpoint that will receive the webhook POST request.
  6. Save the changes to initiate the webhook functionality.

JSON Data Structure

Upon form submission, Comfyform will dispatch a POST request to the defined URL, delivering JSON data such as:

{
    "form": {
        "id": "65b17e9e8638c9ee0a54cd8e",
        "name": "Your Form Name"
    },
    "submission": {
        "id": "66080ccd6b128a2a7bb28900",
        "timestamp": "2024-01-14T18:32:16.270705Z",
        "inputs": [{
            "key": "fullname",
            "values": ["Elon Musk"]
        }, {
            "key": "email",
            "values": ["musk@example.com"]
        }, {
            "key": "message",
            "values": ["Delighted with Comfyform's simplicity and efficiency."]
        }],
        "fileInputs": [{
            "key": "cv",
            "files": [{
                "filename": "cv.pdf",
                "size": 169302,
                "mime": "application/pdf",
                "url": "https://api.comfyform.com/s/file/65b17e9e8638c9ee0a54cd8e/66080ccd6b128a2a7bb28900/66087c079b507f80ce297d4a?key=dgqTKcRzC0LSOzXbcIyLelchXPBnoWD9"
            }]
        }, {
            "key": "materials",
            "files": [{
                "filename": "presentation.pptx",
                "size": 6294027,
                "mime": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
                "url": "https://api.comfyform.com/s/file/65b17e9e8638c9ee0a54cd8e/66080ccd6b128a2a7bb28900/66087c0b08187e358c388458?key=Z75Fm87hlKKuNtOWe7dbHKcSX8UPlvwc"
            }, {
                "filename": "whitepaper.pdf",
                "size": 4399429,
                "mime": "application/pdf",
                "url": "https://api.comfyform.com/s/file/65b17e9e8638c9ee0a54cd8e/66080ccd6b128a2a7bb28900/66087c0ee8ee0354fe11df5f?key=yxu3vZdJLrx1a3Z6wT2ddEO8NLytUx2H"
            }]
        }]
    }
}

Expect to receive all significant details, like the form identity, timestamp, and user input. The structure accounts for multiple entries per field, as may occur with FormData.

Currently, Comfyform doesn’t notify webhooks about spam-flagged submissions, but we plan to include this feature soon.

Automated Retries

If Comfyform’s initial webhook POST request doesn’t receive a status code within the 2XX success status codes range (e.g., 200 OK, 201 Created, 202 Accepted, etc.) from your endpoint, the system will retry automatically according to the following schedule:

AttemptTime from the submission processing
1immediately
25 seconds
315 seconds
41 minute
55 minutes
615 minutes
730 minutes
81 hour
93 hours
108 hours
1116 hours
121 day
132 days
144 days
157 days

We retry several times over a span of a week, giving your endpoint ample opportunity to respond successfully.

Best Practices

  • Secure Your Endpoint: Use HTTPS to ensure all data transferred via webhooks is encrypted.
  • Verify Requests: Add a unique verification token as a query parameter in your webhook URL and validate it server-side to authenticate incoming requests.
  • Manage Load: Prepare your server to efficiently handle potential surges in POST requests following multiple form submissions.
  • Error Handling: Develop robust error handling to manage webhook failures or irregularities gracefully.

Support

Our team is ready to assist with setting up your webhooks or to address any questions you might have. Contact us at support@comfyform.com or connect with other users and our staff on the Comfyform Discord server for shared insights and assistance. Let’s streamline your data processing and make every submission count.