Actions23
Company → Update
AI-generatedOverview
The node interacts with the Plain API to manage company data, specifically supporting an Update operation for the "Company" resource. It allows updating various fields of a company record identified either by its company ID or domain name.
This node is beneficial in scenarios where you need to programmatically maintain or synchronize company information within your workflows, such as updating contract values, changing account owners, or correcting company names and domain names based on external triggers or data sources.
Practical example:
You receive updated contract values from a billing system and want to automatically update the corresponding company records in Plain. Using this node, you can identify the company by its ID or domain name and update the contract value field accordingly.
Properties
| Name | Meaning |
|---|---|
| Company Identifier | Specifies how to identify the company to update. Options: |
| - Company ID (plain company ID) | |
| - Domain Name (company's domain name) | |
| Fields to Update | One or more fields to update on the company. Each field has options: |
| - Company Name: Update the company's name (string) | |
| - Domain Name: Update the company's domain name (string) | |
| - Contract Value: Update the contract value (number) | |
| - Account Owner: Assign a new account owner user (select from loaded users) |
Output
The output JSON contains the updated company object returned by the Plain API after the update mutation.
The company object includes fields such as:
id: Unique identifier of the companyname: Updated company namedomainName: Updated domain namelogoUrl: URL of the company logocreatedAtandupdatedAt: Timestamps of creation and last updatetier: Object containing tier id and namecontractValue: Numeric contract valueaccountOwner: Object with details about the assigned account owner userisDeleted: Boolean flag indicating if the company is deleted
If the update fails, the node throws an error with detailed messages including field-specific errors if available.
No binary data output is produced by this operation.
Dependencies
- Requires an active connection to the Plain API via an API key credential configured in n8n.
- Uses GraphQL mutations to perform updates on the company resource.
- The node dynamically loads user options for the "Account Owner" field using a query to the Plain API.
Troubleshooting
Common issues:
- Missing or incomplete company identifier: The node requires a valid company ID or domain name to identify which company to update.
- No fields specified to update: At least one field must be provided in the "Fields to Update" property.
- API errors returned from Plain API, including validation errors on specific fields.
Error messages:
"Company identifier is required": Ensure that the company identifier collection is filled with either a company ID or domain name.- Validation errors like
"Field errors: <field>: <message>": Check the input values for correctness and compliance with Plain API requirements. - Generic
"Unknown error": Could indicate network issues or misconfiguration of credentials.
Resolution tips:
- Verify that the API key credential is correctly set up and has sufficient permissions.
- Double-check the identifier and update fields for correctness.
- Use the error message details to correct invalid field values.
Links and References
- Plain API Documentation (hypothetical link, replace with actual if available)
- GraphQL Mutation Reference
- n8n Documentation on Creating Custom Nodes