Yesterday's Top Poster

Functions redesigned for agents

  • Thread starter Thread starter Netlify
  • Start date Start date
We have redesigned Netlify functions for an improved agent experience. With these updates, functions are more discoverable, easier to autocomplete, update, and manage for people and agents alike. Note that Netlifly functions are stored at netlify/functions/ and are distinct from Edge Functions. These improvements will not break your existing functions setup so you can update your functions code on your own timeline. Once updated, coding agents will be able to better create, update, and manage functions for you, including for configuring background functions, region selection, and more. To learn more about these updates in-depth, check out our blog on redesigning Netlify functions for agent experience. For a quick summary, you can check out the table below. Feature: Event handlers What changed: Export typed event handlers from the default export object What it means for agents: No magic filenames to guess. Handlers are discoverable like any typed API. What you need to do: Nothing required. Adopt the new syntax for new event handlers for better agent discoverability and updates. Feature: Background functions What changed: Declare with background: true in config instead of the -background filename suffix What it means for agents: Config-driven, not name-driven. Agents can set it without knowing platform naming rules. What you need to do: Nothing required. The -background suffix still works. Feature: Region selection What changed: Set per-function via the region config property, replacing the global UI setting What it means for agents: Agents can set and validate region in code. Use deploy previews to test before going live. What you need to do: Nothing required. Optionally move region out of the UI into config for per-function control. Feature: Memory and vCPU What changed: Set via memory or vcpu config properties; both values scale together automatically What it means for agents: Agents provisioning compute-heavy workloads (inference, large payloads) can do so in code. What you need to do: Nothing. Defaults unchanged. Set only if your workload needs more than 1 GB / 0.5 vCPU. Requires a credit-based Pro plan. Feature: getContext() What changed: Named import from @netlify/functions, replacing the Netlify.context global What it means for agents: Surfaces in autocomplete and agent code-reading. Globals are invisible; imports are discoverable. What you need to do: Nothing required. Netlify.context still works. Switch to getContext() for better discoverability. Learn more in the Netlify Functions documentation, which has also been recently revamped.

Continue reading...
 
Back
Top