Repository navigation
Description
Describe the bug
I am attempting to create a subscription to a workbook using a schedule that doesn't exist at creation time. To perform the same action using Tableau Cloud/Server front-end, the user would configure the subscription by specifying the target type (view or entire workbook), format, subject, and schedule.
Versions
Tableau Cloud
Python 3.12.3
TSC library version 3.24
To Reproduce
# Sign-in to server.
with server.auth.sign_in(tableau_auth):
# Ensure the most recent Tableau REST API version is used.
server.use_highest_version()
# Retrieve the user requiring the new subscription.
user = server.users.filter(name='cmp160130@gmail.com')
# Retreive the subscription's content (e.g., workbook, view)
target = server.workbooks.filter(name='North America Sales')
new_subscription = tsc.SubscriptionItem(
subject='North America Sales (demo)',
schedule_id=tsc.ScheduleItem(
name=None,
priority=None,
schedule_type=None,
execution_order=None,
interval_item=tsc.DailyInterval(time(0),
24.0, 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'
)
),
user_id=user[0].id,
target=tsc.Target(target[0].id, target_type='Workbook')
)
# Subscribe the user to the target content.
server.subscriptions.create(subscription_item=new_subscription)
Results
What are the results or error messages received?
TypeError: cannot serialize <Schedule#None "None" <DailyInterval start=00:00:00 interval=(24.0, 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')>> { _created_at: None, _end_schedule_at: None, _id: None, _next_run_at: None, _state: None, _updated_at: None, interval_item: <DailyInterval start=00:00:00 interval=(24.0, 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')>, _execution_order: None, _name: None, _priority: None, _schedule_type: None} (type ScheduleItem)
If I swap out the subscription item configuration above for the following that uses a pre-existing schedule, then it works fine.
new_subscription = tsc.SubscriptionItem(
subject='North America Sales (demo)',
schedule_id='f3dcaf7a-9668-4eb2-8c20-2f7c21e82744',
user_id=user[0].id,
target=tsc.Target(target[0].id, target_type='Workbook')
)
Activity
jacalata commentedon Dec 8, 2024
I believe this is indeed a requirement, but we could return a better error from the server, and tsc should give a hint too.
CodingOnWindowsOS commentedon Dec 8, 2024
Thank you for the support!
The odd part is that I can manually create a subscription to the workbook using the front-end features, subsequently query that subscription using TSC, and observe the schedule ID, name, priority, etc. are None for that subscription. The date and time the subscription is configured to fire off is populated, but no schedule ID. That's the behavior I am trying to replicate when creating them using TSC and am at a loss as to why it doesn't work.
I also tried copying the schedule item from a preexisting subscription that I manually configured. It also fails. I'll provide a snippet of the subscription object returned where the schedule ID is not populated and corresponds to the subscription mentioned above tomorrow.
Thanks again!
CodingOnWindowsOS commentedon Dec 8, 2024
Manual creation of subscription to workbook.


Below is the subscription retrieved after creating it manually using the front-end. The manual creation process is shown within the two images.
<Subscription#0f1ab430-5b67-45fa-93f9-e2ee9e465601 subject(Daily Sales (testing)) schedule_id(None) user_id(9390ecd3-2278-467c-a636-5486afd3dec1) target(<Target#5faf8999-1ad8-4f0d-b337-b72a3882a418, Workbook>)Using subscription.dict:
{'_id': '0f1ab430-5b67-45fa-93f9-e2ee9e465601', '_attach_image': False, '_attach_pdf': True, 'message': 'Testing', 'page_orientation': 'PORTRAIT', 'page_size_option': 'LETTER', 'schedule_id': None, '_send_if_view_empty': True, 'subject': 'Daily Sales (testing)', '_suspended': False, 'target': <Target#5faf8999-1ad8-4f0d-b337-b72a3882a418, Workbook>, 'user_id': '9390ecd3-2278-467c-a636-5486afd3dec1', 'schedule': [<Schedule#None "None" <DailyInterval start=00:00:00 interval=(24.0, 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')>> { _created_at: None, _end_schedule_at: None, _id: None, _next_run_at: None, _state: None, _updated_at: None, interval_item: <DailyInterval start=00:00:00 interval=(24.0, 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')>, _execution_order: None, _name: None, _priority: None, _schedule_type: None}]}Accessing the schedule attribute of the subscription:
[<Schedule#None "None" <DailyInterval start=00:00:00 interval=(24.0, 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')>> { _created_at: None, _end_schedule_at: None, _id: None, _next_run_at: None, _state: None, _updated_at: None, interval_item: <DailyInterval start=00:00:00 interval=(24.0, 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')>, _execution_order: None, _name: None, _priority: None, _schedule_type: None}]Notice the schedule ID is none as are the vast majority of attributes related to the schedule aside from those necessary for the subscription. I am hoping to achieve the same functionality using TSC. I hope that makes sense! Am I just doing it wrong in my original code example or is something else amiss? @jacalata
jacalata commentedon Jan 3, 2025
OK, looks like I didn't read your first code closely enough. You have this line, where you assign an entire schedule object to the attribute schedule_id , which is only expecting a luid like 0f1ab430-5b67-45fa-93f9-e2ee9e465601:
You want to create the SubscriptionItem without setting a schedule_id, and then do
new_subscription.schedule = tsc.ScheduleItem(....GwenVCX commentedon Jan 28, 2025
I am having the same issue
hahu66 commentedon Mar 11, 2025
I am still getting an error trying to create a subscription on Tableau Cloud v2025.1.0
Versions
Tableau Cloud (dub01.online.tableau.com) 2025.1.0 build 20251.25.0305.2339
Python 3.12.8
REST API 3.25
TSC library version 0.36
Code:
So creating with 'schedule_id=None' fails with the error below.
Also fails with 'schedule_id='' or when leaving schedule_id out of the SubscriptionItem.
I am able to create it with an existing schedule_id . But them you can not change the frequency anymore on TblCloud.
Just to verify all other parameters and settings in the Subscription Item are correct.
(All specified IDs used are real and existing, only masked in this post)
github-actions commentedon Jul 24, 2026
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.
jacalata commentedon Jul 30, 2026
Digging back into this, the
TypeError: cannot serialize None (type NoneType)that @hahu66 hit is a real TSC bug.SubscriptionRequest.create_requnconditionally writesid=Noneinto<schedule>whenschedule_idis None (no guard, unlike the siblingupdate_req), and it does not serialize the.scheduleobject at all. Tableau Cloud'sPOST /subscriptionsendpoint accepts an inline<schedule frequency="..."><frequencyDetails>...</frequencyDetails></schedule>payload (no schedule ID required), which is what the UI produces when you create an "on-schedule" subscription without a pre-existing schedule LUID. TSC only knows how to emit the on-prem-Server payload shape.That gap is the same one tracked in #1373 (Cloud-specific subscription requests) and, from the read side, #1627. Rather than have three copies of the same conversation, I'm closing this one and pointing at #1373 for the fix. If you want to follow along or add repro details, subscribe there.
Thanks for the detailed writeups — they were what let me nail down the exact code path (see
request_factory.py:1345-1347ondevelopment).