activate_schedule
Activate a schedule by its ID to enable automated workflow execution in Alteryx Server.
Instructions
Activate a schedule by its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schedule_id | Yes |
Implementation Reference
- src/mcp_server.py:319-322 (registration)Registers the MCP tool 'activate_schedule' using the @app.tool() decorator. This function serves as the entry point for the tool invocation, delegating execution to the underlying tools.activate_schedule method.@self.app.tool() def activate_schedule(schedule_id: str): """Activate a schedule by its ID""" return self.tools.activate_schedule(schedule_id)
- src/tools.py:630-653 (handler)Core implementation of activate_schedule tool logic. Fetches the current schedule details, constructs an UpdateScheduleContract with enabled=True, updates the schedule via the Alteryx Server API, and returns the formatted response.def activate_schedule(self, schedule_id: str): """Activate a schedule by its ID""" try: schedule = self.schedules_api.schedules_get_schedule(schedule_id) if not schedule: return "Error: Schedule not found" contract = server_client.UpdateScheduleContract( workflow_id=schedule.workflow_id, owner_id=schedule.owner_id, iteration=schedule.iteration, name=schedule.name, comment=schedule.comment, priority=schedule.priority, worker_tag=schedule.worker_tag, enabled=True, credential_id=schedule.credential_id, time_zone=schedule.time_zone, questions=schedule.questions, ) api_response = self.schedules_api.schedules_update_schedule(schedule_id, contract) return pprint.pformat(api_response) except ApiException as e: return f"Error: {e}"