Actions109
- Collections Actions
- Activity Actions
- Assets Actions
- Authentication Actions
- Extensions Actions
- Fields Actions
- Files Actions
- Folders Actions
- Items Actions
- Permissions Actions
- Presets Actions
- Relations Actions
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
- Webhooks Actions
Overview
The Fields → Update operation in this n8n node allows you to update the configuration of a specific field within a collection in your Directus instance. This is useful for programmatically changing field properties such as its type, schema, or metadata without manually editing them through the Directus admin interface.
Common scenarios:
- Changing the data type of a field (e.g., from integer to string).
- Updating the schema or meta information of a field.
- Modifying custom options or settings for a field in bulk or as part of an automated workflow.
Practical example:
Suppose you have a collection called articles and want to update the "status" field to change its type or add additional metadata. This operation lets you do that directly from your n8n workflow.
Properties
| Name | Type | Meaning |
|---|---|---|
| Field | options | Unique name of the field to update. Field names are unique within each collection. |
| Collection | options | The name of the collection containing the field. |
| JSON/RAW Parameters | boolean | If enabled, body parameters are provided as raw JSON; otherwise, use the UI fields below. |
| Body Parameters | json | (Shown if JSON/RAW Parameters is true) Raw JSON object with all body parameters for the update request. |
| Update Fields | collection | (Shown if JSON/RAW Parameters is false) Group of optional fields to update: - Meta (JSON): Meta info. - Schema (JSON): Schema info. - Type: Data type for the field (Directus-specific). |
Output
- The output will be a single object in the
jsonproperty representing the updated field's details as returned by the Directus API. - The structure typically includes field attributes such as
field,type,meta,schema, and any other properties relevant to the field after the update.
Example output:
{
"field": "status",
"type": "string",
"meta": { /* ... */ },
"schema": { /* ... */ },
// ...other field properties
}
Dependencies
- Directus API: Requires access to a running Directus instance.
- API Credentials: You must configure the
directusApicredentials in n8n for authentication.
Troubleshooting
Common issues:
- Invalid field or collection name: Ensure both exist and are spelled correctly.
- Insufficient permissions: The API user must have permission to update fields in the specified collection.
- Malformed JSON: When using JSON/RAW mode, ensure your JSON is valid.
- Type mismatch: Setting an incompatible type may result in errors from Directus.
Error messages and resolutions:
"Field not found": Double-check the field and collection names."Permission denied": Verify API credentials and user permissions."Invalid JSON": Validate your JSON input before submitting.