Actions3
Overview
This node interacts with MediaWiki pages, allowing users to retrieve, edit, or delete pages on a MediaWiki site. It is useful for automating content management tasks on wikis, such as updating documentation, managing user pages, or cleaning up outdated information.
Common scenarios include:
- Fetching the current content and metadata of a wiki page to analyze or process it further.
- Creating new pages or updating existing ones by providing content in either MediaWiki wikitext or Markdown format.
- Deleting pages with an optional reason logged for audit purposes.
Practical examples:
- Automatically update a "Daily Report" page with fresh data converted from Markdown.
- Retrieve a category page's content to extract links or references.
- Remove spam or obsolete pages programmatically with a deletion reason.
Properties
| Name | Meaning |
|---|---|
| Operation | The action to perform on the MediaWiki page. Options: "Get Page", "Edit Page", "Delete Page". |
| Page Title | The exact title of the MediaWiki page to operate on. Must use correct capitalization and spacing (e.g., "Main Page"). |
| Input Format | (Only for Edit operation) The format of the input content. Options: "MediaWiki Wikitext" (content already in wikitext), "Markdown" (content will be converted to wikitext). |
| Page Content | (Only for Edit operation) The full content of the page. Can be provided either as MediaWiki wikitext or Markdown depending on the selected input format. |
| Delete Reason | (Only for Delete operation) A brief explanation for deleting the page, which will appear in the deletion log (e.g., "Spam"). |
Output
The node outputs an array of JSON objects, each representing the result of the operation performed on a page. The structure varies slightly depending on the operation:
Get Page:
{ "success": true, "operation": "get", "title": "Page Title", "response": { /* MediaWiki page content and metadata object */ } }Edit Page:
{ "success": true, "operation": "edit", "title": "Page Title", "response": { /* Result of the edit operation */ }, "originalContent": "Original input content", "inputFormat": "wikitext" | "markdown", "convertedContent": "Converted wikitext content" // present if input was markdown }Delete Page:
{ "success": true, "operation": "delete", "title": "Page Title", "response": { /* Result of the delete operation */ }, "reason": "Optional delete reason" }
If an error occurs and the node is set to continue on failure, the output JSON will contain:
{
"success": false,
"error": "Error message"
}
The node does not output binary data.
Dependencies
- Requires access to a MediaWiki API endpoint via credentials that provide authentication (e.g., an API key or token).
- Uses an internal MediaWiki client library to communicate with the MediaWiki API.
- Converts Markdown to MediaWiki wikitext using an internal converter when editing pages with Markdown input.
No additional environment variables are explicitly required beyond the configured API credentials.
Troubleshooting
- Missing Page Content on Edit: If you attempt to edit a page without providing any content, the node will throw an error stating that page content is required.
- Invalid Operation: Providing an unsupported operation value will cause an error indicating the operation is invalid.
- API Authentication Issues: Failure to authenticate with the MediaWiki API will prevent all operations; ensure valid credentials are configured.
- Incorrect Page Title: Using incorrect capitalization or spacing in the page title may lead to unexpected results or errors since MediaWiki titles are case-sensitive.
- Markdown Conversion Errors: If the Markdown content contains syntax that cannot be converted properly, the resulting wikitext might be malformed, causing edit failures.
To resolve errors:
- Verify all required parameters are correctly set.
- Check API credentials and permissions.
- Confirm page titles match exactly as they appear on the wiki.
- Review the content format and conversion settings.