IFTTT Conditional Logic: Choosing Between Filter Code, Multiple Applets, and Custom Webhooks
Decide how to add conditional logic to IFTTT Applets. Compare Filter Code, multiple Applets, and custom Webhook services, then validate a defensive Filter Code example.
03 Aug 2026, 01:59 UTC

The decision you actually face
You have an IFTTT Applet that fires on every event from a trigger, but you only want the action to run when a specific condition is met—for example, only when a temperature reading exceeds a threshold, or only when a Webhook payload contains a particular sensor ID. The core decision is where that condition should live: inside a single Applet using Filter Code, spread across multiple Applets, or pushed out to a service you control.
Useful takeaway: For simple, synchronous predicates over Webhook JSON or combined trigger ingredients, Filter Code is usually the lowest-maintenance option. Split the logic across multiple Applets only when you need to reuse the same trigger for unrelated actions without writing code. Move to an external Webhook service only when your condition requires state, external API calls, or logic that cannot run in IFTTT's restricted sandbox.
Key terms
- Applet: A single IFTTT automation with one trigger and one or more actions.
- Filter Code: A short JavaScript snippet that sits between the trigger and the action inside an Applet. If it returns
falseor callsskip(), the action does not run. - Ingredients: The data fields exposed by a trigger service (for example, the subject line of an email or the body of a Webhook).
- Webhook: A user-defined HTTP callback that sends a JSON payload to IFTTT to fire a trigger.
- Idempotent: An operation that produces the same result if executed multiple times, which matters because IFTTT may retry failed actions.
Comparing the three supported approaches
| Approach | Best for | Maintenance | Latency impact | Tier-limit impact |
|---|---|---|---|---|
| Filter Code | Simple predicates over Webhook JSON or combined ingredients | Low: one Applet, logic lives in the editor | Minimal: evaluated inside IFTTT before the action | Consumes one Applet slot |
| Multiple Applets | Reusing one trigger across unrelated actions without code | High: duplicated triggers, shared state is difficult | Higher: each Applet polls independently | Consumes multiple Applet slots |
| Custom Webhook service | Complex state machines, external data lookups, high-frequency logic | High: you own the service, deployment, and monitoring | Added network hop between IFTTT and your service | Consumes one Applet slot plus external infrastructure |
Trade-offs that matter in practice
Filter Code runs in a restricted sandbox. Asynchronous callbacks, external network requests, and heavy computation are unreliable or blocked. If your condition needs to call a third-party API, maintain state across runs, or perform more than lightweight data transformation, Filter Code is not the right tool.
Splitting one logical condition across multiple Applets avoids code but multiplies maintenance. Each Applet consumes a slot from your plan's limit, and coordinating shared state between them is awkward. You may end up chaining Applets through Webhooks, which adds latency and makes debugging harder because a failure in one Applet does not automatically roll back another.
Offloading to a custom Webhook service or the IFTTT Platform API supports complex state machines, but it adds infrastructure, latency, and operational burden outside IFTTT. You become responsible for uptime, schema changes, and security. This is justified only when the logic genuinely cannot be expressed as a synchronous predicate.
IFTTT delivery is polling-based and best-effort. Even correct conditional logic cannot guarantee real-time or exactly-once action execution. Your actions should be idempotent regardless of how conditions are evaluated.
Concrete implementation: defensive Filter Code with a Webhook trigger
The following example assumes you have connected the IFTTT Webhooks service and created an Applet with a maker or Webhook trigger. The exact ingredient name for the JSON body varies by platform revision; replace webhookPayload with the name shown in your live editor.
Where to run this
- Filter Code: Paste into the Filter Code editor between your Webhooks trigger and the chosen action.
- Test request: Run from your terminal. You need your personal Webhooks key, available in the IFTTT Webhooks service settings.
Filter Code
// Filter Code runs in IFTTT's editor between trigger and action.
// Replace webhookPayload with the exact ingredient name shown in your editor.
let data = {};
try {
data = JSON.parse(webhookPayload || '{}');
} catch (err) {
// If the payload is not valid JSON, skip the action rather than fail silently.
skip();
}
const temperature = Number(data.temperature);
const sensorId = String(data.sensor_id || '');
if (!Number.isFinite(temperature) || temperature <= 25) {
skip();
}
const allowedSensors = ['sensor-a', 'sensor-b'];
if (!allowedSensors.includes(sensorId)) {
skip();
}
// If execution reaches this point, the action proceeds.
Sending a test Webhook
Historically, IFTTT Webhooks used the endpoint below. Verify the current URL and payload format in IFTTT's developer documentation before production use.
# Run from your terminal. Replace YOUR_WEBHOOK_KEY with the key from
# your IFTTT Webhooks settings.
curl -X POST \
-H "Content-Type: application/json" \
-d '{"temperature": 30, "sensor_id": "sensor-a"}' \
"https://maker.ifttt.com/trigger/sensor_reading/with/key/YOUR_WEBHOOK_KEY"
Expected checks and risks
- Expected check: Open the Applet's activity log in IFTTT. A passing payload should show the action running; a failing payload should show that the action was skipped.
- Risk: Webhook payloads are JSON. Missing defensive parsing in Filter Code can cause silent failures when upstream services alter their schema. The
try/catchandNumber.isFiniteguards above reduce that risk. - Risk: Your Webhook key is a secret. Treat the test command output and shell history accordingly.
- Rollback: Creating a test Applet changes state by consuming an Applet slot. To roll back, delete the test Applet from the IFTTT dashboard. This stops further executions and frees the slot.
Limitations and current verification
Per-tier Applet counts, execution quotas, and polling intervals vary by IFTTT plan. Verify current limits before scaling a multi-Applet design. Filter Code globals and helper functions have changed across IFTTT platform revisions; confirm the supported API surface in the live editor. IFTTT may retry failed actions, so side effects should be idempotent regardless of how conditions are evaluated.
Practical validation plan
- Build a test Applet with a Webhooks trigger and Filter Code that returns
false. Send a request and confirm the action is skipped in the activity log. - Change the predicate to
true, resend the same request, and confirm the action runs. - If you are considering multiple Applets, measure end-to-end latency for the same predicate implemented as one Filter Code Applet versus two separate Applets over 24 hours.
- Review IFTTT's current developer documentation for the exact Filter Code API and Webhooks payload format before production deployment.
If your validation shows that the predicate is simple, synchronous, and fits inside the sandbox, keep it in Filter Code. If you find yourself duplicating triggers or needing state, that is the signal to redesign around a single external service rather than more Applets.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.