MediaWiki Add Page
AI-generatedSummary
Creates a page in a MediaWiki site via the Action API, logging in with bot credentials for each input item. If the page already exists, it either skips it or overwrites it, depending on the "If Page Exists" setting.
Inputs
- Wiki URL — Overrides the site URL from the mediaWikiApi credentials. A trailing slash is stripped and /api.php is appended.
- Title (required) — Title of the page to create.
- Page Content (required) — Content to write, usually wikitext. It is sent as the edit text.
- Content Model — Content model sent with the edit: wikitext (default), css, GeoJson, javascript, json or text.
- If Page Exists — Ignore (default) skips the page if it exists. Overwrite replaces its content.
- Edit Summary — Edit summary recorded in page history. Defaults to "Page created via n8n".
Output shape
One output item per input item, paired to its input. Each item has a json object with success, pageTitle, action (created, overwritten or skipped) and pageExists. Created and overwritten items also include result, the edit object returned by the MediaWiki API. Skipped items include a message instead.
For each item, the node does a full login (login token, then login, then CSRF token) and an existence check before editing. Login uses the credentials' botUsername and botPassword. If the login or edit fails, the node throws an error. With Continue On Fail enabled, it instead emits {success:false, error} for that item. The edit is not sent with createonly, so a race that creates the page between the check and the edit would be overwritten.
Examples
Example 1: Create a documentation page from upstream data, leaving existing pages untouched
Title = {{$json.title}}, Page Content = {{$json.body}}, Content Model = Wikitext, If Page Exists = Ignore
Example 2: Keep a JSON data page on the wiki in sync with each run
Title = Data:Config.json, Page Content = {{JSON.stringify($json)}}, Content Model = JSON, If Page Exists = Overwrite, Edit Summary = Sync from n8n
Example 3: Publish to a different wiki using the same bot account
Wiki URL = https://other.example.com, Title and Page Content set, If Page Exists = Ignore